package UDT::Simple;

use 5.012004;
use strict;
use warnings;

require Exporter;

our @ISA = qw(Exporter);

# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

# This allows declaration	use UDT::Simple ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'all' => [ qw(
) ] );

our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

our @EXPORT = qw(

our $VERSION = '0.02';

require XSLoader;
XSLoader::load('UDT::Simple', $VERSION);

# Preloaded methods go here.

# Below is stub documentation for your module. You'd better edit it!

=head1 NAME

UDT::Simple - simplified Perl bindings for UDT(reliable UDP based application level data transport protocol -


    # example server: (using SOCK_DGRAM $client->recv() 
                       will automatically use recvmsg 
                       instead of recv)
    my $server = UDT::Simple->new(AF_INET,SOCK_STREAM);
    while (my $client = $u->accept()) {
       my $data = $client->recv(11);

    # example client: (using SOCK_DGRAM $u->send()
                       will automatically use sendmsg
                       instead of send()
    my $u = UDT::Simple->new(AF_INET,SOCK_STREAM);

    # if the socket is SOCK_STREAM send() might not send the whole thing
    my $message = "hello world";
    my $offset = 0;
    while (lenght($message) - $offset > 0) {
        $offset += $u->send($message,$offset);
    $u->send("hello world")

    # if it is SOCK_DGRAM the whole message will be sent


 apt-get install libudt-dev
 perl Makefile.PL
 make && make install

or download libudt, install it, and run

 UDT_INCLUDE=/custom/path/to/udt.h perl && make && make install


quote from L<>:

 UDT is a high performance data transfer protocol - UDP-based
 data transfer protocol. It was designed for data intensive 
 applications over high speed wide area networks, to overcome
 the efficiency and fairness problems of TCP. As its name
 indicates, UDT is built on top of UDP and it provides both
 reliable data streaming and messaging services.

this module offers incomplete bindings for, requires C<libudt>
see L<> for how to install it.

=head1 AUTHOR

borislav nikolov, E<lt>jack@sofialondonmoskva.comE<gt>


Copyright (C) 2014 by borislav nikolov

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.12.4 or,
at your option, any later version of Perl 5 you may have available.