Revision: 2588
http://unicore.svn.sourceforge.net/unicore/?rev=2588&view=rev
Author: oistrez
Date: 2008-03-26 07:37:37 -0700 (Wed, 26 Mar 2008)
Log Message:
-----------
fufex redesign
Added Paths:
-----------
unicorex/uas-udt/trunk/src/main/cplusplus/built.sh
unicorex/uas-udt/trunk/src/main/cplusplus/readme.txt
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/LICENSE.txt
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/Makefile
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/README.txt
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/Makefile
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appclient.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appclient.exe
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appserver.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appserver.exe
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/cc.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/recvfile.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/recvfile.exe
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/sendfile.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/sendfile.exe
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/udt.dll
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/accept.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/bind.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ccc.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/close.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/connect.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/copy.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ecode.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/error.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/faq.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/footer.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/function.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/header.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/intro.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/listen.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/make.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/opt.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/peername.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recv.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvfile.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvmsg.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/reference.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/select.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/send.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/sendfile.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/sendmsg.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/socket.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/sockname.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/structure.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-cc.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-config.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-data.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-error.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-file.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-firewall.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-hello.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-intro.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-msg.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/t-udt3.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/trace.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/treeview.css
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/tutorial.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/udtdoc.css
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_book.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_down.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_end.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_endm.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_endp.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_leaf.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_line.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_link.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_list.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_listm.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_listp.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_open.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_space.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/hlp/ix_up.gif
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/index.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/main.htm
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/Makefile
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/api.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/api.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/buffer.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/buffer.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/ccc.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/ccc.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/channel.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/channel.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/common.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/common.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/control.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/control.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/core.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/core.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/list.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/list.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/packet.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/packet.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/queue.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/queue.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/udt.dll
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/udt.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/udt.lib
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/window.cpp
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/src/window.h
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/appclient.vcproj
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/appserver.vcproj
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/recvfile.vcproj
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/sendfile.vcproj
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/udt.ncb
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/udt.sln
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/udt.suo
unicorex/uas-udt/trunk/src/main/cplusplus/udt4/win/udt.vcproj
Added: unicorex/uas-udt/trunk/src/main/cplusplus/built.sh
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/built.sh (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/built.sh 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,5 @@
+cd udt4
+make
+cd ..
+g++ -shared -I./udt4/src -L./udt4/src -lpthread -ludt -o libfufex.so -fPIC fufex.cpp
+cp ./udt4/src/libudt.so .
Property changes on: unicorex/uas-udt/trunk/src/main/cplusplus/built.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: unicorex/uas-udt/trunk/src/main/cplusplus/readme.txt
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/readme.txt (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/readme.txt 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,30 @@
+//**************************************************
+// FUFEX
+//
+// The "Flexible Udp/Udt File EXchange" library
+// (fufex) is part of the UDT File Transfer
+// implementation for the UNICORE software.
+//
+// Author: Thomas Oistrez
+//**************************************************
+
+//**************************************************
+// UDT
+//
+// see udt4/README.txt and udt4/LICENSE.txt
+// for license information
+//**************************************************
+
+CONTENT:
+./fufex.cpp: the fufex library
+./built.sh : script to built the fufex library
+./udt4 : the UDT library version 4.1
+
+
+To make fufex:
+ ./built.sh
+
+To install:
+ copy "libfufex.so"
+ and "libudt.so"
+ into the library path
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/LICENSE.txt
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/LICENSE.txt (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/LICENSE.txt 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,32 @@
+Copyright (c) 2001 - 2007, The Board of Trustees of the University of Illinois.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+
+* Redistributions in binary form must reproduce the
+ above copyright notice, this list of conditions
+ and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the University of Illinois
+ nor the names of its contributors may be used to
+ endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/Makefile
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/Makefile (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/Makefile 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,7 @@
+DIRS = src app
+TARGETS = all clean install
+
+$(TARGETS): %: $(patsubst %, %.%, $(DIRS))
+
+$(foreach TGT, $(TARGETS), $(patsubst %, %.$(TGT), $(DIRS))):
+ $(MAKE) -C $(subst ., , $@)
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/README.txt
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/README.txt (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/README.txt 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,42 @@
+Copyright (c) 2001 - 2007, The Board of Trustees of the University of Illinois.
+All Rights Reserved.
+
+UDP-based Data Transfer (UDT) Library - version 4
+Author: Yunhong Gu
+
+UDT version 4 is free software under BSD License. See ./LICENSE.txt.
+
+============================================================================
+
+UDT Website:
+http://udt.sf.net
+http://sf.net/projects/udt/
+
+
+CONTENT:
+./src: UDT source code
+./app: Example programs
+./doc: UDT documentation (HTML)
+./win: VS.Net project files for the Windows version of UDT
+
+
+To make:
+ make -e os=XXX arch=YYY
+
+XXX: [LINUX(default), BSD, OSX]
+YYY: [IA32(default), POWERPC, IA64, AMD64]
+
+For example, on OS X, you may need to do "make -e os=OSX arch=POWERPC";
+on 32-bit i386 Linux system, simply use "make".
+
+On Windows systems, use the Visual Studio .NET project files in ./win directory.
+
+
+To use UDT in your application:
+Read index.htm in ./doc. The documentation is in HTML format and requires your
+browser to support JavaScript.
+
+
+Questions? please post to the udt-help forum or the udt-general mailing list:
+http://sourceforge.net/forum/forum.php?forum_id=393037
+http://sourceforge.net/mailarchive/forum.php?forum_id=44580
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/Makefile
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/Makefile (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/Makefile 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,54 @@
+C++ = g++
+
+ifndef os
+ os = LINUX
+endif
+
+ifndef arch
+ arch = IA32
+endif
+
+CCFLAGS = -Wall -D$(os) -I../src -O2 -finline-functions
+
+ifeq ($(arch), IA32)
+ CCFLAGS += -DIA32 #-mcpu=pentiumpro -march=pentiumpro -mmmx -msse
+endif
+
+ifeq ($(arch), POWERPC)
+ CCFLAGS += -mcpu=powerpc
+endif
+
+ifeq ($(arch), IA64)
+ CCFLAGS += -DIA64
+endif
+
+LDFLAGS = -L../src -ludt -lstdc++ -lpthread -lm
+
+ifeq ($(os), UNIX)
+ LDFLAGS += -lsocket
+endif
+
+OBJS = appserver.o appclient.o sendfile.o recvfile.o
+
+DIR = $(shell pwd)
+
+all: appserver appclient sendfile recvfile
+
+%.o: %.cpp
+ $(C++) $(CCFLAGS) $< -c
+
+appserver: appserver.o
+ $(C++) $^ -o $@ $(LDFLAGS)
+appclient: appclient.o
+ $(C++) $^ -o $@ $(LDFLAGS)
+sendfile: sendfile.o
+ $(C++) $^ -o $@ $(LDFLAGS)
+recvfile: recvfile.o
+ $(C++) $^ -o $@ $(LDFLAGS)
+
+clean:
+ rm -f *.o
+ rm -f appserver appclient sendfile recvfile
+
+install:
+ export PATH=$(DIR):$$PATH
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appclient.cpp
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appclient.cpp (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appclient.cpp 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,165 @@
+#ifndef WIN32
+ #include <unistd.h>
+ #include <cstdlib>
+ #include <cstring>
+ #include <netdb.h>
+#else
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+#endif
+#include <iostream>
+#include <udt.h>
+#include "cc.h"
+
+using namespace std;
+
+#ifndef WIN32
+void* monitor(void*);
+#else
+DWORD WINAPI monitor(LPVOID);
+#endif
+
+int main(int argc, char* argv[])
+{
+ if ((3 != argc) || (0 == atoi(argv[2])))
+ {
+ cout << "usage: appclient server_ip server_port" << endl;
+ return 0;
+ }
+
+ struct addrinfo hints, *local, *peer;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ //hints.ai_socktype = SOCK_DGRAM;
+
+ if (0 != getaddrinfo(NULL, "9000", &hints, &local))
+ {
+ cout << "incorrect network address.\n" << endl;
+ return 0;
+ }
+
+ UDTSOCKET client = UDT::socket(local->ai_family, local->ai_socktype, local->ai_protocol);
+
+ // UDT Options
+ //UDT::setsockopt(client, 0, UDT_CC, new CCCFactory<CUDPBlast>, sizeof(CCCFactory<CUDPBlast>));
+ //UDT::setsockopt(client, 0, UDT_MSS, new int(9000), sizeof(int));
+ //UDT::setsockopt(client, 0, UDT_SNDBUF, new int(10000000), sizeof(int));
+ //UDT::setsockopt(client, 0, UDP_SNDBUF, new int(10000000), sizeof(int));
+
+ #ifdef WIN32
+ UDT::setsockopt(client, 0, UDT_MSS, new int(1052), sizeof(int));
+ #endif
+
+ // for rendezvous connection, enable the code below
+ /*
+ UDT::setsockopt(client, 0, UDT_RENDEZVOUS, new bool(true), sizeof(bool));
+ if (UDT::ERROR == UDT::bind(client, local->ai_addr, local->ai_addrlen))
+ {
+ cout << "bind: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+ */
+
+ freeaddrinfo(local);
+
+ if (0 != getaddrinfo(argv[1], argv[2], &hints, &peer))
+ {
+ cout << "incorrect server/peer address. " << argv[1] << ":" << argv[2] << endl;
+ return 0;
+ }
+
+ // connect to the server, implict bind
+ if (UDT::ERROR == UDT::connect(client, peer->ai_addr, peer->ai_addrlen))
+ {
+ cout << "connect: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ freeaddrinfo(peer);
+
+ // using CC method
+ //CUDPBlast* cchandle = NULL;
+ //int temp;
+ //UDT::getsockopt(client, 0, UDT_CC, &cchandle, &temp);
+ //if (NULL != cchandle)
+ // cchandle->setRate(500);
+
+ int size = 100000;
+ char* data = new char[size];
+
+ #ifndef WIN32
+ pthread_create(new pthread_t, NULL, monitor, &client);
+ #else
+ CreateThread(NULL, 0, monitor, &client, 0, NULL);
+ #endif
+
+ for (int i = 0; i < 1000000; i ++)
+ {
+ int ssize = 0;
+ int ss;
+ while (ssize < size)
+ {
+ if (UDT::ERROR == (ss = UDT::send(client, data + ssize, size - ssize, 0)))
+ {
+ cout << "send:" << UDT::getlasterror().getErrorMessage() << endl;
+ break;
+ }
+
+ ssize += ss;
+ }
+
+ if (ssize < size)
+ break;
+ }
+
+ UDT::close(client);
+
+ delete [] data;
+
+ return 1;
+}
+
+#ifndef WIN32
+void* monitor(void* s)
+#else
+DWORD WINAPI monitor(LPVOID s)
+#endif
+{
+ UDTSOCKET u = *(UDTSOCKET*)s;
+
+ UDT::TRACEINFO perf;
+
+ cout << "SendRate(Mb/s)\tRTT(ms)\tCWnd\tPktSndPeriod(us)\tRecvACK\tRecvNAK" << endl;
+
+ while (true)
+ {
+ #ifndef WIN32
+ sleep(1);
+ #else
+ Sleep(1000);
+ #endif
+
+ if (UDT::ERROR == UDT::perfmon(u, &perf))
+ {
+ cout << "perfmon: " << UDT::getlasterror().getErrorMessage() << endl;
+ break;
+ }
+
+ cout << perf.mbpsSendRate << "\t\t"
+ << perf.msRTT << "\t"
+ << perf.pktCongestionWindow << "\t"
+ << perf.usPktSndPeriod << "\t\t\t"
+ << perf.pktRecvACK << "\t"
+ << perf.pktRecvNAK << endl;
+ }
+
+ #ifndef WIN32
+ return NULL;
+ #else
+ return 0;
+ #endif
+}
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appclient.exe
===================================================================
(Binary files differ)
Property changes on: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appclient.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appserver.cpp
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appserver.cpp (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appserver.cpp 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,152 @@
+#ifndef WIN32
+ #include <unistd.h>
+ #include <cstdlib>
+ #include <cstring>
+ #include <netdb.h>
+#else
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+#endif
+#include <iostream>
+#include <udt.h>
+#include "cc.h"
+
+using namespace std;
+
+#ifndef WIN32
+void* recvdata(void*);
+#else
+DWORD WINAPI recvdata(LPVOID);
+#endif
+
+
+int main(int argc, char* argv[])
+{
+ if ((1 != argc) && ((2 != argc) || (0 == atoi(argv[1]))))
+ {
+ cout << "usage: appserver [server_port]" << endl;
+ return 0;
+ }
+
+ addrinfo hints;
+ addrinfo* res;
+
+ memset(&hints, 0, sizeof(struct addrinfo));
+
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = SOCK_STREAM;
+ //hints.ai_socktype = SOCK_DGRAM;
+
+ string service("9000");
+ if (2 == argc)
+ service = argv[1];
+
+ if (0 != getaddrinfo(NULL, service.c_str(), &hints, &res))
+ {
+ cout << "illegal port number or port is busy.\n" << endl;
+ return 0;
+ }
+
+ UDTSOCKET serv = UDT::socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+
+
+ // UDT Options
+ //UDT::setsockopt(serv, 0, UDT_CC, new CCCFactory<CUDPBlast>, sizeof(CCCFactory<CUDPBlast>));
+ //UDT::setsockopt(serv, 0, UDT_MSS, new int(9000), sizeof(int));
+ //UDT::setsockopt(serv, 0, UDT_RCVBUF, new int(10000000), sizeof(int));
+ //UDT::setsockopt(serv, 0, UDP_RCVBUF, new int(10000000), sizeof(int));
+
+
+ if (UDT::ERROR == UDT::bind(serv, res->ai_addr, res->ai_addrlen))
+ {
+ cout << "bind: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ freeaddrinfo(res);
+
+
+ cout << "server is ready at port: " << service << endl;
+
+ if (UDT::ERROR == UDT::listen(serv, 10))
+ {
+ cout << "listen: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+
+ sockaddr_storage clientaddr;
+ int addrlen = sizeof(clientaddr);
+
+ UDTSOCKET recver;
+
+ while (true)
+ {
+ if (UDT::INVALID_SOCK == (recver = UDT::accept(serv, (sockaddr*)&clientaddr, &addrlen)))
+ {
+ cout << "accept: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ char clienthost[NI_MAXHOST];
+ char clientservice[NI_MAXSERV];
+ getnameinfo((sockaddr *)&clientaddr, addrlen, clienthost, sizeof(clienthost), clientservice, sizeof(clientservice), NI_NUMERICHOST|NI_NUMERICSERV);
+ cout << "new connection: " << clienthost << ":" << clientservice << endl;
+
+ #ifndef WIN32
+ pthread_t rcvthread;
+ pthread_create(&rcvthread, NULL, recvdata, new UDTSOCKET(recver));
+ pthread_detach(rcvthread);
+ #else
+ CreateThread(NULL, 0, recvdata, new UDTSOCKET(recver), 0, NULL);
+ #endif
+ }
+
+ UDT::close(serv);
+
+ return 1;
+}
+
+#ifndef WIN32
+void* recvdata(void* usocket)
+#else
+DWORD WINAPI recvdata(LPVOID usocket)
+#endif
+{
+ UDTSOCKET recver = *(UDTSOCKET*)usocket;
+ delete (UDTSOCKET*)usocket;
+
+ char* data;
+ int size = 100000;
+ data = new char[size];
+
+ while (true)
+ {
+ int rsize = 0;
+ int rs;
+ while (rsize < size)
+ {
+ if (UDT::ERROR == (rs = UDT::recv(recver, data + rsize, size - rsize, 0)))
+ {
+ cout << "recv:" << UDT::getlasterror().getErrorMessage() << endl;
+ break;
+ }
+
+ rsize += rs;
+ }
+
+ if (rsize < size)
+ break;
+ }
+
+ delete [] data;
+
+ UDT::close(recver);
+
+ #ifndef WIN32
+ return NULL;
+ #else
+ return 0;
+ #endif
+}
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appserver.exe
===================================================================
(Binary files differ)
Property changes on: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/appserver.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/cc.h
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/cc.h (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/cc.h 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,100 @@
+#include <udt.h>
+#include <ccc.h>
+
+class CTCP: public CCC
+{
+public:
+ void init()
+ {
+ m_bSlowStart = true;
+ m_issthresh = 83333;
+
+ m_dPktSndPeriod = 0.0;
+ m_dCWndSize = 2.0;
+
+ setACKInterval(2);
+ setRTO(1000000);
+ }
+
+ virtual void onACK(const int& ack)
+ {
+ if (ack == m_iLastACK)
+ {
+ if (3 == ++ m_iDupACKCount)
+ DupACKAction();
+ else if (m_iDupACKCount > 3)
+ m_dCWndSize += 1.0;
+ else
+ ACKAction();
+ }
+ else
+ {
+ if (m_iDupACKCount >= 3)
+ m_dCWndSize = m_issthresh;
+
+ m_iLastACK = ack;
+ m_iDupACKCount = 1;
+
+ ACKAction();
+ }
+ }
+
+ virtual void onTimeout()
+ {
+ m_issthresh = getPerfInfo()->pktFlightSize / 2;
+ if (m_issthresh < 2)
+ m_issthresh = 2;
+
+ m_bSlowStart = true;
+ m_dCWndSize = 2.0;
+ }
+
+protected:
+ virtual void ACKAction()
+ {
+ if (m_bSlowStart)
+ {
+ m_dCWndSize += 1.0;
+
+ if (m_dCWndSize >= m_issthresh)
+ m_bSlowStart = false;
+ }
+ else
+ m_dCWndSize += 1.0/m_dCWndSize;
+ }
+
+ virtual void DupACKAction()
+ {
+ m_bSlowStart = false;
+
+ m_issthresh = getPerfInfo()->pktFlightSize / 2;
+ if (m_issthresh < 2)
+ m_issthresh = 2;
+
+ m_dCWndSize = m_issthresh + 3;
+ }
+
+protected:
+ int m_issthresh;
+ bool m_bSlowStart;
+
+ int m_iDupACKCount;
+ int m_iLastACK;
+};
+
+
+class CUDPBlast: public CCC
+{
+public:
+ CUDPBlast()
+ {
+ m_dPktSndPeriod = 1000000;
+ m_dCWndSize = 83333.0;
+ }
+
+public:
+ void setRate(int mbps)
+ {
+ m_dPktSndPeriod = (m_iMSS * 8.0) / mbps;
+ }
+};
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/recvfile.cpp
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/recvfile.cpp (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/recvfile.cpp 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,83 @@
+#ifndef WIN32
+ #include <arpa/inet.h>
+#else
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+#endif
+#include <fstream>
+#include <iostream>
+#include <cstdlib>
+#include <udt.h>
+
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+ if ((argc != 5) || (0 == atoi(argv[2])))
+ {
+ cout << "usage: recvfile server_ip server_port remote_filename local_filename" << endl;
+ return 0;
+ }
+
+ UDTSOCKET fhandle = UDT::socket(AF_INET, SOCK_STREAM, 0);
+
+ sockaddr_in serv_addr;
+ serv_addr.sin_family = AF_INET;
+ serv_addr.sin_port = htons(short(atoi(argv[2])));
+#ifndef WIN32
+ if (inet_pton(AF_INET, argv[1], &serv_addr.sin_addr) <= 0)
+#else
+ if (INADDR_NONE == (serv_addr.sin_addr.s_addr = inet_addr(argv[1])))
+#endif
+ {
+ cout << "incorrect network address.\n";
+ return 0;
+ }
+ memset(&(serv_addr.sin_zero), '\0', 8);
+
+ if (UDT::ERROR == UDT::connect(fhandle, (sockaddr*)&serv_addr, sizeof(serv_addr)))
+ {
+ cout << "connect: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ // send name information of the requested file
+ int len = strlen(argv[3]);
+
+ if (UDT::ERROR == UDT::send(fhandle, (char*)&len, sizeof(int), 0))
+ {
+ cout << "send: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ if (UDT::ERROR == UDT::send(fhandle, argv[3], len, 0))
+ {
+ cout << "send: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ // get size information
+ int64_t size;
+
+ if (UDT::ERROR == UDT::recv(fhandle, (char*)&size, sizeof(int64_t), 0))
+ {
+ cout << "send: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ // receive the file
+ ofstream ofs(argv[4], ios::out | ios::binary | ios::trunc);
+ int64_t recvsize;
+
+ if (UDT::ERROR == (recvsize = UDT::recvfile(fhandle, ofs, 0, size)))
+ {
+ cout << "recvfile: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ UDT::close(fhandle);
+
+ ofs.close();
+
+ return 1;
+}
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/recvfile.exe
===================================================================
(Binary files differ)
Property changes on: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/recvfile.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/sendfile.cpp
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/sendfile.cpp (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/sendfile.cpp 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,111 @@
+#ifndef WIN32
+ #include <cstdlib>
+#else
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+#endif
+#include <fstream>
+#include <iostream>
+#include <udt.h>
+
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+ //usage: sendfile [server_port]
+ if ((2 < argc) || ((2 == argc) && (0 == atoi(argv[1]))))
+ {
+ cout << "usage: sendfile [server_port]" << endl;
+ return 0;
+ }
+
+ UDTSOCKET serv = UDT::socket(AF_INET, SOCK_STREAM, 0);
+
+#ifdef WIN32
+ int mss = 1052;
+ UDT::setsockopt(serv, 0, UDT_MSS, &mss, sizeof(int));
+#endif
+
+ int port = 9000;
+ if (2 == argc)
+ port = atoi(argv[1]);
+
+ sockaddr_in my_addr;
+ my_addr.sin_family = AF_INET;
+ my_addr.sin_port = htons(port);
+ my_addr.sin_addr.s_addr = INADDR_ANY;
+ memset(&(my_addr.sin_zero), '\0', 8);
+
+ if (UDT::ERROR == UDT::bind(serv, (sockaddr*)&my_addr, sizeof(my_addr)))
+ {
+ cout << "bind: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ cout << "server is ready at port: " << port << endl;
+
+ UDT::listen(serv, 1);
+
+ sockaddr_in their_addr;
+ int namelen = sizeof(their_addr);
+
+ UDTSOCKET fhandle;
+
+ if (UDT::INVALID_SOCK == (fhandle = UDT::accept(serv, (sockaddr*)&their_addr, &namelen)))
+ {
+ cout << "accept: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ UDT::close(serv);
+
+ // aquiring file name information from client
+ char file[1024];
+ int len;
+
+ if (UDT::ERROR == UDT::recv(fhandle, (char*)&len, sizeof(int), 0))
+ {
+ cout << "recv: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ if (UDT::ERROR == UDT::recv(fhandle, file, len, 0))
+ {
+ cout << "recv: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+ file[len] = '\0';
+
+ // open the file
+ ifstream ifs(file, ios::in | ios::binary);
+
+ ifs.seekg(0, ios::end);
+ int64_t size = ifs.tellg();
+ ifs.seekg(0, ios::beg);
+
+ // send file size information
+ if (UDT::ERROR == UDT::send(fhandle, (char*)&size, sizeof(int64_t), 0))
+ {
+ cout << "send: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ UDT::TRACEINFO trace;
+ UDT::perfmon(fhandle, &trace);
+
+ // send the file
+ if (UDT::ERROR == UDT::sendfile(fhandle, ifs, 0, size))
+ {
+ cout << "sendfile: " << UDT::getlasterror().getErrorMessage() << endl;
+ return 0;
+ }
+
+ UDT::perfmon(fhandle, &trace);
+ cout << "speed = " << trace.mbpsSendRate << endl;
+
+ UDT::close(fhandle);
+
+ ifs.close();
+
+ return 1;
+}
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/sendfile.exe
===================================================================
(Binary files differ)
Property changes on: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/sendfile.exe
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/udt.dll
===================================================================
(Binary files differ)
Property changes on: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/app/udt.dll
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/accept.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/accept.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/accept.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>accept</strong></h4>
+<p>The <b>accept</b> method retrieves an incoming connection.</p>
+
+<div class="code">UDTSOCKET accept(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ struct sockaddr* <font color="#FFFFFF">addr</font>,<br />
+ int* <font color="#FFFFFF">addrlen</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a listening socket.</dd>
+ <dt><em>addr</em></dt>
+ <dd>[out] Address of the peer side of the new accepted connection.</dd>
+ <dt><em>addrlen</em></dt>
+ <dd>[out] Length of the <i>addr</i> structure.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>If no error occurs, <b>accept</b> returns the UDT socket descriptor of the new connection; otherwise, it returns
+ UDT::INVALID_SOCK.</p>
+<p>On a successful return, the address of the peer
+ side of the connection is written into <i>addr</i>, and its length is in <i>addrlen</i>, if the <i>addr</i> parameter is not NULL.</p>
+<p>If an error is returned, the error information
+ can be retrieved by <a href="error.htm">getlasterror</a>. One of the following error can cause an <b>accept</b> error:</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is an invalid UDT socket.</td>
+ </tr>
+ <tr>
+ <td>ENOLISTEN</td>
+ <td>5006</td>
+ <td><i>u</i> is not in the listening state.</td>
+ </tr>
+ <tr>
+ <td>ERDVNOSERV</td>
+ <td>5007</td>
+ <td><i>u</i> is set up to support rendezvous connection.</td>
+ </tr>
+ <tr>
+ <td>EASYNCRCV</td>
+ <td>6002</td>
+ <td><i>u</i> is non-blocking (UDT_RCVSYN = false) but there is no connection available.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>Once a UDT socket is in listening state, it accepts new connections and maintains the pending connections in a queue. An <strong>accept</strong> call retrieves
+the first connection in the queue, removes it from the queue, and returns the associate socket descriptor. </p>
+<p>If there is no connections in the queue when <strong>accept</strong> is called, a blocking socket will wait until a new connection is set up, whereas a
+non-blocking socket will return immediately with an error.</p>
+<p>The accepted sockets will inherit all proper attributes from the listening socket.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="listen.htm">listen</a>, <a href="connect.htm">connect</a>, <a href="opt.htm">setsockopt</a>, <a href="opt.htm">getsockopt</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/bind.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/bind.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/bind.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,70 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>bind</strong></h4>
+<p>The <b>bind</b> method binds a UDT socket to a known or an available local address.</p>
+
+<div class="code">int bind(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ struct sockaddr* <font color="#FFFFFF">name</font>,<br />
+ int* <font color="#FFFFFF">namelen</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a UDT socket.</dd>
+ <dt><em>name</em></dt>
+ <dd>[out] Address to assign to the socket from the <u>sockaddr</u> structure.</dd>
+ <dt><em>namelen</em></dt>
+ <dd>[out] Length of the <i>name</i> structure.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>If the binding is successful, bind returns 0, otherwise it returns UDT::ERROR and the specific error information can be retrieved using <a
+href="error.htm">getlasterror</a>.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>EBOUNDSOCK</td>
+ <td>5001</td>
+ <td><i>u</i> has already been bound to certain address.</td>
+ </tr>
+ <tr>
+ <td>EINVPARAM</td>
+ <td>5003</td>
+ <td>the address is either invalid or unavailable.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is an invalid UDT socket.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>The <strong>bind</strong> method is usually to assign a UDT socket a local address, including IP address and port number. If INADDR_ANY is used, a proper IP address will be used once
+the UDT connection is set up. If 0 is used for the port, a randomly available port number will be used. The method <a href="sockname.htm">getsockname</a> can be used to retrieve this port
+number.</p>
+<p>The <strong>bind</strong> call is necessary in all cases except for a socket to <a href="listen.htm">listen</a>. If <strong>bind</strong> is not called, UDT will automatically bind a
+socket to a randomly available address when a connection is set up.</p>
+<p>By default, UDT will reuse existing UDP port for new UDT sockets, unless UDT_REUSEADDR is set to false. When UDT_REUSEADDR is false, UDT will create an exclusive UDP port for this UDT socket. UDT_REUSEADDR must be called before <strong>bind</strong>. </p>
+<h5>See Also</h5>
+<p><strong><a href="listen.htm">listen</a>, <a href="connect.htm">connect</a>, <a href="opt.htm">setsockopt</a>, <a href="opt.htm">getsockopt</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ccc.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ccc.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ccc.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Introduction</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: CCC </div>
+<h3><font color="#000080">Base Congestion Control Class</font></h3>
+<p>The following class CCC (some details are omitted) is the base class that a user-define congestion control algorithm should inherit from and overload the proper functions.</p>
+
+<p>The class definition is in ccc.h, all new control algorithms definition should include this header file.</p>
+
+<div class="code">
+ <p>class CCC<br />
+ {<br />
+ public:<br />
+ CCC();<br />
+ virtual ~CCC() {}
+ </p>
+ public:<br />
+ virtual void init() {}<br />
+ virtual void close() {}<br />
+ virtual void onACK(const int& ack) {}<br />
+ virtual void onLoss(const int* losslist, const int& size) {}
+ virtual void onTimeout() {}<br />
+ virtual void onPktSent(const CPacket* pkt) {}<br />
+ virtual void onPktReceived(const CPacket* pkt) {}<br />
+ virtual void processCustomMsg(const CPacket& pkt) {}<br />
+ <br />
+ protected:<br />
+ void setACKTimer(const int& msINT);<br />
+ void setACKInterval(const int& pktINT);<br />
+ void setRTO(const int& usRTO);<br />
+ void sendCustomMsg(CPacket& pkt) const; <br />
+ const UDT::TRACEINFO* getPerfInfo();<br />
+ <br />
+ protected:<br />
+ double m_dPktSndPeriod;<br />
+ double m_dCWndSize;<br />
+ <br />
+ int m_iMSS;<br />
+ int m_iRTT;<br />
+ }; </p>
+</div>
+
+<p>void <strong>init</strong>()</p>
+
+<p>This is the callback function to be called at the start of a UDT connection. It can be used to initialize the packet sending period, initial sending rate, etc. It can also be used to
+start timer thread. It is RECOMMENDED that the initializations are done in this method, rather than in the constructor.</p>
+
+<p>void <strong>close</strong>()</p>
+
+</p>The clear-ups can be done in this method.</p>
+
+<p>void <strong>onACK</strong>(ack)</p>
+
+<p>This is the callback function to be called when an ACK is received. The parameter of ack is the acknowledged packet sequence number.</p>
+
+<p>void <strong>onLoss</strong>(losslist, size)</p>
+
+<p>This callback function is called when the sender detects a loss event, e.g., by duplicate ACK or explicit loss report. losslist is the packet sequence numbers of the lost packets and size
+the length of the loss list.</p>
+
+<p>void <strong>onTimeout</strong>()</p>
+
+<p>This callback function is called when a timeout event occurs if there is unacknowledged data in the sender side.</p>
+
+<p>void <strong>onPktSent</strong>(pkt)</p>
+
+<p>This callback function is called when a data packet is sent. All the packet information can be accessed though the pkt pointer. This callback function is useful to record the packet
+timestamp in a delay-based approach and compute RTT in onACK(), because UDT does not compute RTT for all packets.</p>
+
+<p>See UDT specification and ./src/packet.cpp for the packet structure.</p>
+
+<p>void <strong>onPktReceived</strong>(pkt)</p>
+
+<p>This callback function is called when a data packet is received. Packet information can be accessed through pkt.</p>
+
+<p>void <strong>processCustomMsg</strong>(pkt)</p>
+
+<p>This callback function tells UDT how to process user defined control message (pkt).</p>
+
+<p>void <strong>setACKTimer</strong>(msINT)</p>
+
+<p>This method is used to enable timer-based acknowledging and set the ACK timer. It should be called by an inherited class (for example, in init()) if the new congestion control need
+timer-based acknowledging. msINT is the ACK timer in millisecond. Note that the highest precision of the ACK timer depends on the specific platform, and cannot exceed 1 millisecond.</p>
+
+<p>void <strong>setACKInterval</strong>(pktINT)</p>
+
+<p>This method is used to configure the number of packets to be received before an ACK is sent. This is the default acknowledging method and by default every packet will be acknowledged.
+Packet-based and timer-based acknowledging are exclusive. pktINT is the packet interval.</p>
+
+<p>void <strong>setRTO</strong>(usRTO)</p>
+
+<p>This method is used to set timeout value. The value usRTO is measured by microseconds.</p>
+
+<p>void <strong>sendCustomMsg</strong>(pkt)</p>
+
+<p>The method can be used to send a user defined control message. The control message pkt must conform to the packet format defined in ./src/packet.cpp. IMPORTANT: This message is sent
+through UDP; therefore, it is not guaranteed to be sent successfully nor in order.</p>
+
+<p>const UDT::TRACEINFO* <strong>getPerfInfo</strong>()</p>
+
+<p>The internal UDT parameters and flow statistics can be read using this method. This is similar to the perfmon() method.</p>
+
+<p>double <strong>m_dPktSndPeriod</strong></p>
+
+<p>This is the packet sending period that should be updated by a rate control algorithm. If a pure window based algorithm is used, fix this variable to 0. It is measured by microsecond.</p>
+
+<p>double <strong>m_dCWndSize</strong></p>
+
+<p>This is the congestion window size that should updated by window control algorithm. If a pure rate control algorithm is used, fix this variable to infinite.</p>
+
+<h5>See Also</h5>
+<p><a href="t-cc.htm"><strong>User-defined congestion controls</strong></a></p>
+
+<p> </p>
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/close.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/close.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/close.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,60 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>close</strong></h4>
+<p>The <b>close</b> method closes a UDT connection.</p>
+
+<div class="code">int close(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying the socket to close.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>If success, 0 is returned; otherwise, UDT::ERROR is returned and specific error information can be retrieved by <a href="error.htm">getlasterror</a>.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is an invalid UDT socket.</td>
+ </tr>
+ <tr>
+ <td>EASYNCSND</td>
+ <td>6001</td>
+ <td><i>u</i> is non-blocking (UDT_RCVSYN = false) but <a href="opt.htm">UDT_LINGER</a> option is set to be a non-zero value.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>The <strong>close</strong> method gracefully shutdowns the UDT connection and releases all related data structures associated with the UDT socket. If there is no connection associated
+with the socket, <strong>close</strong> simply release the socket resources.</p>
+<p>On a blocking socket, if UDT_LINGER is non-zero, the <strong>close</strong> call will wait until all data in the sending buffer are sent out or the waiting time has exceeded the
+expiration time set by UDT_LINGER. On a non-blocking socket, <strong>close</strong> will return immediately.</p>
+<p>The closing UDT socket will send a shutdown message to the peer side so that the peer socket will also be closed. This is a best-effort message. If the message is not successfully
+delivered, the peer side will also be closed after a time-out. In UDT, <u>shutdown</u> is not supported.</p>
+<p>All sockets should be closed if they are not used any more.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="socket.htm">socket</a>, <a href="opt.htm">setsockopt</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/connect.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/connect.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/connect.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,87 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>connect</strong></h4>
+<p>The <b>connect</b> method connects to a server socket (in regular mode) or a peer socket (in rendezvous mode) to set up a UDT connection.</p>
+
+<div class="code">int connect(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ const struct sockaddr* <font color="#FFFFFF">name</font>,<br />
+ int* <font color="#FFFFFF">namelen</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a socket.</dd>
+ <dt><em>name</em></dt>
+ <dd>[out] Address of the server or the peer socket.</dd>
+ <dt><em>namelen</em></dt>
+ <dd>[out] Length of the <i>name</i> structure.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>If success, 0 is returned; otherwise, UDT::ERROR is returned and specific error information can be retrieved by <a href="error.htm">getlasterror</a>.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>ENOSERVER</td>
+ <td>1001</td>
+ <td>server or peer socket does not exist, or there is no network connection.</td>
+ </tr>
+ <tr>
+ <td>ECONNREJ</td>
+ <td>1002</td>
+ <td>the connection request was rejected by the peer.</td>
+ </tr>
+ <tr>
+ <td>ESECFAIL</td>
+ <td>1004</td>
+ <td>connection was aborted due to possible attacks.</td>
+ </tr>
+ <tr>
+ <td>ECONNSOCK</td>
+ <td>5002</td>
+ <td>the socket is not allowed to do a <strong>connect</strong>connect call; it is either in listening state or has been already connected.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is not a valid socket ID.</td>
+ </tr>
+ <tr>
+ <td>ERDVUNBOUND</td>
+ <td>5008</td>
+ <td>the rendezvous mode has been enable, but <strong>bind</strong> was not called before <strong>connect</strong>.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>UDT is connection oriented, for both of its SOCK_STREAM and SOCK_DGRAM mode. <strong>connect</strong> must be called in order to set up a UDT connection. The <i>name</i> parameter is
+the address of the server or the peer side. In regular (default) client/server mode, the server side must has called <strong>bind</strong> and <strong>listen</strong>. In rendezvous mode,
+both sides must call <strong>bind</strong> and connect to each other at (approximately) the same time. Rendezvous <strong>connect</strong> may not be used for more than one connections on the same UDP port pair, in which case UDT_REUSEADDR may be set to false. </p>
+<p><strong>connect</strong> takes at least one round trip to finish. This may become a bottleneck if applications frequently connect and disconnect to the same address.</p>
+<p>The blocking option does NOT affect the <strong>connect</strong> call, which is always blocked until the connection is either successfully set up or failed.</p>
+<p>When <strong>connect</strong> fails, the UDT socket can still be used to connect again. However, if the socket was not bound before, it may be bound implicitly, as mentioned above, even
+if the <strong>connect</strong> fails. In addition, in the situation when the <strong>connect</strong> call fails, the UDT socket will not be automatically released, it is the application
+developer's responsibility to <strong>close</strong> the socket, if he/she does not need it anymore (e.g., to re-connect).</p>
+
+<h5>See Also</h5>
+<p><strong><a href="listen.htm">listen</a>, <a href="bind.htm">bind</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/copy.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/copy.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/copy.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Copyright & License </div>
+
+<p>Copyright (c) 2001 - 2007, The Board of Trustees of the University of Illinois.<br />
+All rights reserved.</p>
+<p>Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:</p>
+<ol>
+ <li> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
+ <li> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.</li>
+ <li> Neither the name of the University of Illinois
+ nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</li>
+</ol>
+<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING<br />
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.<br />
+</p>
+<h4 class="func_name"> </h4>
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ecode.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ecode.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/ecode.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,195 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Error Codes </div>
+
+<h3><font color="#000080">UDT Error Codes List </font></h3>
+
+<p>All UDT API will return an error upon a failed operation. Particularly, UDT defines UDT::INVALID_SOCK and UDT::ERROR as error returned values. (several routines return false as error value.) Application should check the return value against these two constants.</p>
+
+<table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="15%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="15%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="70%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>SUCCESS</td>
+ <td>0</td>
+ <td>success operation.</td>
+ </tr>
+ <tr>
+ <td>ECONNSETUP</td>
+ <td>1000</td>
+ <td>connection setup failure.</td>
+ </tr>
+ <tr>
+ <td>ENOSERVER</td>
+ <td>1001</td>
+ <td>server does not exist.</td>
+ </tr>
+ <tr>
+ <td>ECONNREJ</td>
+ <td>1002</td>
+ <td>connection request was rejected by server.</td>
+ </tr>
+ <tr>
+ <td>ESOCKFAIL</td>
+ <td>1003</td>
+ <td>could not create/configure UDP socket.</td>
+ </tr>
+ <tr>
+ <td>ESECFAIL</td>
+ <td>1004</td>
+ <td>connection request was aborted due to security reasons.</td>
+ </tr>
+ <tr>
+ <td>ECONNFAIL</td>
+ <td>2000</td>
+ <td>connection failure.</td>
+ </tr>
+ <tr>
+ <td>ECONNLOST</td>
+ <td>2001</td>
+ <td>connection was broken.</td>
+ </tr>
+ <tr>
+ <td>ENOCONN</td>
+ <td>2002</td>
+ <td>connection does not exist.</td>
+ </tr>
+ <tr>
+ <td>ERESOURCE</td>
+ <td>3000</td>
+ <td>system resource failure.</td>
+ </tr>
+ <tr>
+ <td>ETHREAD</td>
+ <td>3001</td>
+ <td>could not create new thread.</td>
+ </tr>
+ <tr>
+ <td>ENOBUF</td>
+ <td>3002</td>
+ <td>no memory space.</td>
+ </tr>
+ <tr>
+ <td>EFILE</td>
+ <td>4000</td>
+ <td>file access error.</td>
+ </tr>
+ <tr>
+ <td>EINVRDOFF</td>
+ <td>4001</td>
+ <td>invalid read offset.</td>
+ </tr>
+ <tr>
+ <td>ERDPERM</td>
+ <td>4002</td>
+ <td>no read permission.</td>
+ </tr>
+ <tr>
+ <td>EINVWROFF</td>
+ <td>4003</td>
+ <td>invalid write offset.</td>
+ </tr>
+ <tr>
+ <td>EWRPERM</td>
+ <td>4004</td>
+ <td>no write permission.</td>
+ </tr>
+ <tr>
+ <td>EINVOP</td>
+ <td>5000</td>
+ <td>operation not supported.</td>
+ </tr>
+ <tr>
+ <td>EBOUNDSOCK</td>
+ <td>5001</td>
+ <td>cannot execute the operation on a bound socket.</td>
+ </tr>
+ <tr>
+ <td>ECONNSOCK</td>
+ <td>5002</td>
+ <td>cannot execute the operation on a connected socket.</td>
+ </tr>
+ <tr>
+ <td>EINVPARAM</td>
+ <td>5003</td>
+ <td>bad parameters.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td>invalid UDT socket.</td>
+ </tr>
+ <tr>
+ <td>EUNBOUNDSOCK</td>
+ <td>5005</td>
+ <td>cannot listen on unbound socket.</td>
+ </tr>
+ <tr>
+ <td>ENOLISTEN</td>
+ <td>5006</td>
+ <td>(accept) socket is not in listening state.</td>
+ </tr>
+ <tr>
+ <td>ERDVNOSERV</td>
+ <td>5007</td>
+ <td>rendezvous connection process does not allow listen and accept call.</td>
+ </tr>
+ <tr>
+ <td>ERDVUNBOUND</td>
+ <td>5008</td>
+ <td>rendezvous connection setup is enabled but bind has not been called before connect.</td>
+ </tr>
+ <tr>
+ <td>ESTREAMILL</td>
+ <td>5009</td>
+ <td>operation not supported in SOCK_STREAM mode.</td>
+ </tr>
+ <tr>
+ <td>EDGRAMILL</td>
+ <td>5010</td>
+ <td>operation not supported in SOCK_DGRAM mode.</td>
+ </tr>
+ <tr>
+ <td>EDUPLISTEN</td>
+ <td>5011</td>
+ <td>another socket is already listening on the same UDP port.</td>
+ </tr>
+ <tr>
+ <td>ELARGEMSG</td>
+ <td>5012</td>
+ <td>message is too large to be hold in the sending buffer.</td>
+ </tr>
+ <tr>
+ <td>EASYNCFAIL</td>
+ <td>6000</td>
+ <td>non-blocking call failure.</td>
+ </tr>
+ <tr>
+ <td>EASYNCSND</td>
+ <td>6001</td>
+ <td>no buffer available for sending.</td>
+ </tr>
+ <tr>
+ <td>EASYNCRCV</td>
+ <td>6002</td>
+ <td>no data available for read.</td>
+ </tr>
+</table>
+
+<h5>See Also</h5>
+<p><strong><a href="error.htm">getlasterror</a></strong></p>
+
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/error.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/error.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/error.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>getlasterror</strong></h4>
+<p>The <b>getlasterror</b> method the last UDT error within the same thread.</p>
+
+<div class="code">ERRORINFO& getlasterror(<br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dd>None.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>The last UDT error within the same thread is retrieved and returned in an <a href = "structure.htm">ERRORINFO</a> structure. If there is no error, a special SUCCESS code (0) will be
+returned. The <strong>getlasterror</strong> will always succeed. The returned value is a reference to the internal UDT ERRORINFO structure and application may clear it if necessary. </p>
+
+<h5>Description</h5>
+<p>The <strong>getlasterror</strong> method reads the last UDT error in the thread where this method is called. The error information is stored in thread specific storage.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="ecode.htm">Error Code List</a></strong>, <a href="t-error.htm"><strong>Error Handling</strong></a> </p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/faq.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/faq.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/faq.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,76 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<h3><font color="#000080">Frequent Asked Questions </font></h3>
+<p>1. <a href="#1">What is UDT?</a><br>
+2. <a href="#2">Who developed UDT?</a><br>
+3. <a href="#3">Why do I need UDT?</a><br>
+4. <a href="#4">My application uses UDT, can I run it over a traditional low bandwidth network, or even on the public Internet?</a><br>
+5. <a href="#5">Why can't I reach the expected high throughput with Gigabit NIC?</a><br>
+6. <a href="#6">Can you give me some hints in tuning the performance?</a><br>
+7. <a href="#7">I use UDT for file transfer, but it seems significantly slower than memory-memory transfer. Why?</a><br>
+8. <a href="#8">When I run the example applications, it prompts for missing library error. What happens?</a><br>
+9. <a href="#9">Does UDT care about the byte order conversion between different platforms?</a><br>
+10. <a href="#10">Why can't the UDT connection be set up? Why listen or connect call fails?</a><br>
+11. <a href="#11">Is the UDT connection secure?</a><br>
+12. <a href="#12">Why does my application often have packet loss even though the throughput is much lower than the available bandwidth?</a><br>
+13. <a href="#13">Is UDT TCP friendly?</a><br>
+14. <a href="#14">What copyright and license issues shall I be aware of when using UDT?</a><br>
+15. <a href="#15">Is UDT only suitable for bulk data?</a><br>
+16. <a href="#16">What's the relationship between UDT and SABUL?</a><br>
+17. <a href="#17">Where can I find help regarding to the use of UDT library?</a><br>
+18. <a href="#18">What background knowledge is necessary in order to use UDT?</a></p>
+
+<hr />
+
+<p><strong><a name="1" id="1"></a>1. What is UDT?</strong></p>
+<p>UDT stands for UDP-based Data Transfer. It can refer to both the UDT protocol and its implementation (the UDT library). Basically, UDT is built on top of UDP by adding reliability control and congestion control.</p>
+<p><strong><a name="2" id="2"></a>2. Who developed UDT?</strong></p>
+<p>UDT is a research product of the National Center for Data Mining (NCDM) at the University of Illinois at Chicago. The project was supported in part by US National Science Foundation, US Department of Energy, and US Army. </p>
+<p><strong><a name="3" id="3"></a>3. Why and when do I need UDT?</strong></p>
+<p>The original (and major) purpose of UDT is to provide a high performance transfer interface to distributed data intensive applications over a wide area network, where TCP seldom works well for efficiency and fairness reasons. It can also be used in other situation where TCP is not suitable (e.g., multimedia streaming, firewall punching, partial reliability, etc.)</p>
+<p>There is no explicit standard to determine when to use UDT or when not to. Generally speaking, if you are not satisfied with TCP's performance or functionality, UDT is probably what you need, especially in high speed networks where a small number of bulk sources share the abundant bandwidth.</p>
+<p><strong><a name="4" id="4"></a>4. My application uses UDT, can I run it over a traditional low bandwidth network, or even on the public Internet?</strong></p>
+<p>Yes, you can do it. But please be aware that your application may use a large amount of bandwidth and may be regarded as attack or improper use of network by ISPs and firewalls. In addition, UDT's impact on the Internet is not comprehensively tested yet.</p>
+<p><strong><a name="5" id="5"></a>5. Why can't I reach the announced high throughput with my Gigabit NIC?</strong></p>
+<p>There are many factors that can affect the throughput, especially for Gigabit NICs.</p>
+<p>First of all, you need to test it using some other benchmark tools like IPerf. They will give you the highest performance for the current configuration. If UDT has similar performance, then it is all right, and you need to tune your network settings.</p>
+<p>If UDT's performance is much lower than the performance obtained from the benchmark, try to modify the UDT options.</p>
+<p>Finally, your applications affect the transfer speed. Any data intensive applications can cost substantial CPU time in computing and memory replication, which will affect UDT's performance. Try to test the throughput with the example applications in the UDT SDK.</p>
+<p><strong> <a name="6" id="6"></a>6. Can you give me some hints in tuning the performance?</strong></p>
+<p>Please read the Configuration section of the UDT Tutorial for the answer. The default UDT parameter are set for high speed networks. If your network bandwidth is siginicantly slower (<< 1Gb/s), you may set smaller buffer sizes. </p>
+<p><strong><a name="7" id="7"></a>7. I use UDT for file transfer, but it seems significantly slower than memory-memory transfer. Why?</strong></p>
+<p>Performance of file transfer is often limited by the bottleneck speed of disk IO. Besides, disk IO is often bursting and cause difficulties for the congestion control of transport protocols. UDT has been thoroughly tested for the disk-disk transfer scenario. Try to use some benchmark software to test your disk performance.</p>
+<p><strong> <a name="8" id="8"></a>8. When I run the example applications, it prompts for missing library error. What happens?</strong></p>
+<p>You forget to set the system environment of library path. On Linux/BSD/UNIX, use "export" or "setenv" to configure the LD_LIBRARY_PATH environment variable so that it contains the directory having the libudt.so file. On Windows, copy udt.dll file to the same directory containing you UDT applications (this usually also works for Linux/BSD/UNIX by copying libudt.so to the current working directory).</p>
+<p><strong><a name="9" id="9"></a>9. Does UDT care about the byte order conversion between different platforms?</strong></p>
+<p>No, the application should care about the conversion itself. However, UDT does work between different platforms even with different byte orders.</p>
+<p><strong><a name="10" id="10"></a>10. Why the UDT connection cannot be set up? Why does the listen or connect call fail?</strong></p>
+<p>The most likely reason is that one of the machines is behind a firewall. You can change the firewall settings if you have the privilege or do something in the UDT program to bypass the firewall. Note that UDT has same semantics as TCP and generates UDP traffic in both directions. UDT4 also provides rendezvous connection setup in order to punch firewalls.</p>
+<p>Another reason is that at least one of the server or client sides has multiple addresses, and UDT is bound to an address different from what you use in the application. To solve the problem, explicitly set the IP address in bind call.</p>
+<p>There can be other reasons, such as domain name lookup failure. Try to use an explicit IP address if possible.</p>
+<p><strong><a name="11" id="11"></a>11. Is UDT connection secure?</strong></p>
+<p>No. If you need a secure connection, you should add other mechanisms on the top of UDT in your application.</p>
+<p><strong><a name="12" id="12"></a>12. Why does my application often have packet loss even the throughput is much lower than the available bandwidth?</strong></p>
+<p>There may be many reasons for packet loss, such as network congestion and hardware failure. Try to use some other benchmark or network test tools first to check the network. Improper setting of UDT parameters may also cause similar problem. Set UDP_RCVBUF as large as UDT_RCVBUF.</p>
+<p><strong><a name="13" id="13"></a>13. Is UDT TCP friendly?</strong></p>
+<p>TCP friendliness is an obscure concept. Please refer to UDT technical reports for detailed information on the competition between UDT flows and TCP flows.
+<p><strong><a name="14" id="14"></a>14. What copyright and license issues shall I be aware of when using UDT?</strong></p>
+<p>UDT version 4 is released under BSD license. You may find a copy of the license within the UDT release. Previous UDT versions were released under Lesser GPL (LGPL). </p>
+<p><strong><a name="15" id="15"></a>15. Is UDT only suitable for bulk data?</strong></p>
+<p>No, UDT can transfer a data buffer from one single byte to multiple tera-bytes, as long as your system can provide enough resources. However, UDT is indeed optimized for bulk data, and it may not have any better performance for message signaling applications.</p>
+<p><strong><a name="16" id="16"></a>16. What's the relationship between UDT and SABUL?</strong></p>
+<p>UDT is the successor of SABUL. It removes the TCP connection from SABUL and enhances the congestion/flow control.</p>
+<p><strong><a name="17" id="17"></a>17. Where can I find help regarding to the use of UDT library?</strong></p>
+<p>If you cannot find answers in this documentation, please go to the UDT home at sourceforge.net and post your questions. In order to help more users easily find answers about UDT usage and help increase the activity of this project, please post all general questions to the <a href="http://sourceforge.net/forum/forum.php?forum_id=393037" target="_blank">souceforge forum</a> or send them to the <a href="http://sourceforge.net/mail/?group_id=115059" target="_blank">sourceforge mailing list</a>. The forum and the mailing list are monitored by the UDT developers and your questions will be replied as soon as possible.</p>
+<p><strong><a name="18" id="18"></a>18. What background knowledge is necessary in order to use UDT?</strong></p>
+<p>Knowledge on socket programming and C++ is necessary. Knowledge on TCP is a plus.</p>
+<p> </p>
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/footer.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/footer.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/footer.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,14 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>footer</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<hr />
+Copyright © 2001 - 2007 <a target="_blank" href="http://www.ncdm.uic.edu">National Center for Data Mining</a>. All rights reserved.<br />
+Last modified: Thursday, April 19, 2007 04:00 PM.
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/function.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/function.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/function.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,105 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h3><font color="#000080">UDT Socket Functions</font></h3>
+
+<p>The UDT socket functions are contained in the UDT namespace. The methods are listed in the table below:</p>
+
+<table width="100%" border="1" cellpadding="1" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Method</strong></td>
+ <td width="83%" class="table_headline"><strong>Fuctionality</strong></td>
+ </tr>
+ <tr>
+ <td><a href="accept.htm">accept</a></td>
+ <td>accept a connection.</td>
+ </tr>
+ <tr>
+ <td><a href="bind.htm">bind</a></td>
+ <td>assign a local name to an unnamed udt socket.</td>
+ </tr>
+ <tr>
+ <td><a href="close.htm">close</a></td>
+ <td>close the opened UDT entity and shutdown the connection.</td>
+ </tr>
+ <tr>
+ <td><a href="connect.htm">connect</a></td>
+ <td>connect to the server or the peer side.</td>
+ </tr>
+ <tr>
+ <td><a href="error.htm">getlasterror</a></td>
+ <td>retrieve last UDT error in the current thread.</td>
+ </tr>
+ <tr>
+ <td><a href="peername.htm">getpeername</a></td>
+ <td>read the address of the peer side of the connection</td>
+ </tr>
+ <tr>
+ <td><a href="sockname.htm">getsockname</a></td>
+ <td>read the local address of the UDT socket.</td>
+ </tr>
+ <tr>
+ <td><a href="opt.htm">getsockopt</a></td>
+ <td>read UDT options.</td>
+ </tr>
+ <tr>
+ <td><a href="listen.htm">listen</a></td>
+ <td>enable UDT into listening state and is ready for connection request.</td>
+ </tr>
+ <tr>
+ <td><a href="perfmon.htm">perfmon</a></td>
+ <td>monitor internal protocol parameters and udt performance.</td>
+ </tr>
+ <tr>
+ <td><a href="recv.htm">recv</a></td>
+ <td>receive data.</td>
+ </tr>
+ <tr>
+ <td><a href="recvfile.htm">recvfile</a></td>
+ <td>receive data into a file.</td>
+ </tr>
+ <tr>
+ <td><a href="recvmsg.htm">recvmsg</a></td>
+ <td>receive a message.</td>
+ </tr>
+ <tr>
+ <td><a href="select.htm">select</a></td>
+ <td>wait for a number of UDT sockets to change status.</td>
+ </tr>
+ <tr>
+ <td><a href="send.htm">send</a></td>
+ <td>send data.</td>
+ </tr>
+ <tr>
+ <td><a href="sendfile.htm">sendfile</a></td>
+ <td>send a file.</td>
+ </tr>
+ <tr>
+ <td><a href="sendmsg.htm">sendmsg</a></td>
+ <td>send a message.</td>
+ </tr>
+ <tr>
+ <td><a href="opt.htm">setsockopt</a></td>
+ <td>configure UDT options.</td>
+ </tr>
+ <tr>
+ <td><a href="socket.htm">socket</a></td>
+ <td>create a new UDT socket.</td>
+ </tr>
+</table>
+
+<h5>See Also</h5>
+<p><strong><a href="structure.htm">UDT Socket Structures</a></strong></p>
+
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/header.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/header.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/header.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Untitled Document</title>
+</head>
+
+<body>
+<hr />
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/intro.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/intro.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/intro.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Introduction</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<h3><font color="#000080">UDT: UDP-based Data Transfer Library - version 4</font></h3>
+<p><b>Yunhong Gu</b></p>
+
+<p>Welcome to the UDT4 SDK documentation.</p>
+<p>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. </p>
+<p>Visit <a href="http://udt.sf.net">http://udt.sf.net</a> for most recent news on UDT.</p>
+
+<p>Check out most current UDT release at <a target="_blank" href="http://sourceforge.net/projects/udt/">SourceForge</a> or from <a target="_blank" href="http://udt.cvs.sourceforge.net/udt/">CVS</a>.</p>
+
+<p><tt class="note1">export CVS_RSH=ssh</tt><br>
+ <tt class="note1">cvs -d:pserver:anonymous@... login</tt><br>
+ <tt class="note1"><i>[NOTE: when prompt for password, press the RETURN/ENTER key]</i></tt><br>
+ <tt class="note1">cvs -d:pserver:anonymous@... co UDT4</tt></p>
+
+<p>In this documentation:</p>
+<ul>
+ <li><a href="intro.htm">Introduction</a></li>
+ <li><a href="make.htm">Installation</a></li>
+ <li><a href="tutorial.htm">Tutorial</a></li>
+ <li><a href="reference.htm">Reference</a></li>
+ <li><a href="faq.htm">FAQ</a></li>
+ <li><a href="copy.htm">Copyright</a></li>
+</ul>
+<p> </p>
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/listen.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/listen.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/listen.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,69 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>listen</strong></h4>
+<p>The <b>listen</b> method enables a server UDT entity to wait for clients to connect.</p>
+
+<div class="code">int list(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font><br />
+ int <font color="#FFFFFF">backlog</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying the server socket.</dd>
+ <dt><i>backlog</i></dt>
+ <dd>[in] Maximum number of pending connections.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>If success, 0 is returned; otherwise, UDT::ERROR is returned and specific error information can be retrieved by <a href="error.htm">getlasterror</a>.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>ECONNSOCK</td>
+ <td>5002</td>
+ <td><i>u</i> is already connected.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is an invalid socket.</td>
+ </tr>
+ <tr>
+ <td>EUNBOUNDSOCK</td>
+ <td>5005</td>
+ <td><i>u</i> is not bound.</td>
+ </tr>
+ <tr>
+ <td>ERDVNOSERV</td>
+ <td>5007</td>
+ <td><i>u</i> is in rendezvous mode.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>The <strong>listen</strong> method lets a UDT socket enter listening state. The socket must call <strong>bind</strong> before a <strong>listen</strong> call. In addition, if the
+socket is enable for rendezvous mode, neither <strong>listen</strong> nor <strong>accept</strong> can be used on the socket. A UDT socket can call <strong>listen</strong> more than once,
+in which case only the first call is effective, while all subsequent calls will be ignored if the socket is already in listening state.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="bind.htm">bind</a>, <a href="accept.htm">accpet</a>, <a href="connect.htm">connect</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/make.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/make.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/make.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Introduction</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+<style type="text/css">
+<!--
+.style1 {color: #CC0000}
+.style2 {color: #0000FF}
+-->
+</style>
+</head>
+
+<body>
+<h3><font color="#000080">Installation Guide</font></h3>
+<p>The UDT library is distributed with source code, example applications, and documentation. Currently the source code can be compiled on both Linux and Windows system.</p>
+
+<p>Here is the content of the distribution:</p>
+
+<p><tt class="note1"><span class="style2">./src</span>: UDT source code</tt><br>
+ <tt class="note1"><span class="style2">./app</span>: Example applications</tt><br>
+ <tt class="note1"><span class="style2">./doc</span>: UDT documentation</tt><br>
+<tt class="note1"><span class="style2">./win</span>: Visual C++ project files for Windows version of UDT</tt></p>
+
+<p>The library is in the original source code format without any installation tools, so installation is simply a make command. To make the C++ source code on different platform, the user
+needs to explicitly tell <i>make</i> the current operating system and hardware architecture with the "-e" option (except for Windows).</p>
+<p>The available operating system options are: LINUX, BSD, and OSX. <br> The available options for hardware architecture are: IA32, IA64, POWERPC, and AMD64.</p>
+
+<p>The command is in the format:</p>
+
+<p class="style1">make -e os=XXX arch=YYY</p>
+
+</p>where XXX and YYY are one of the options above. Note that it is case sensitive. There is a default value for Linux on the IA32 architecture, so if UDT is compiled on it, simply use
+make.</p>
+
+</p>On Windows, use the Visual Studio .Net project files at ./win directory. It requires Visual C++ 7.0 or above to compile. If other Windows compilers are used, you may need to create
+your own Makefile or project files.</p>
+
+</p>After a successful make, you can begin to use the UDT library. The (only) header file udt.h and the library libudt.a (depending on the target system, libudt.so, libudt.dylib, and udt.dll
+may be available) are located in ./src directory.</p>
+
+</p>Proper environment configuration should be set up before using UDT library. For example, if using libudt.so, the library path environment variable must be updated as:</p>
+
+</p>export LD_LIBRARY_PATH=<location of libudt.so>:$LD_LIBRARY_PATH</p>
+
+<p>On Windows, copy udt.dll to the proper directory.</p>
+<p> </p>
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/opt.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/opt.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/opt.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,194 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>getsockopt</strong></h4>
+<h4 class="func_name"><strong>setsockopt</strong></h4>
+<p>The <b>getsockopt</b> and <b>setsockopt</b> methods read and set UDT options, respectively.</p>
+
+<div class="code">
+ int getsockopt(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ int <font color="#FFFFFF">level</font>,<br />
+ SOCKOPT <font color="#FFFFFF">optname</font>,<br />
+ char* <font color="#FFFFFF">optval</font>,<br />
+ int* <font color="#FFFFFF">optlen</font><br />
+ ); <br><br />
+ int setsockopt(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ int <font color="#FFFFFF">level</font>,<br />
+ SOCKOPT <font color="#FFFFFF">optname</font>,<br />
+ const char* <font color="#FFFFFF">optval</font>,<br />
+ int <font color="#FFFFFF">optlen</font><br />
+ );
+</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a UDT socket.</dd>
+ <dt><em>level</em></dt>
+ <dd>[in] Unused. For compatibility only.</dd>
+ <dt><em>optName</em></dt>
+ <dd>[in] The enum name of UDT option. The names and meanings are listed in the table below.</dd>
+ <dt> </dt>
+ <table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="12%" class="table_headline"><strong>Name</strong></td>
+ <td width="9%" class="table_headline"><strong>Type</strong></td>
+ <td width="27%" class="table_headline"><strong>Meaning</strong></td>
+ <td width="52%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>UDT_MSS</td>
+ <td>int</td>
+ <td>Maximum packet size (bytes).</td>
+ <td>Including all UDT, UDP, and IP headers. Default 1500 bytes.</td>
+ </tr>
+ <tr>
+ <td>UDT_SNDSYN</td>
+ <td>bool</td>
+ <td>synchronization mode of data sending.</td>
+ <td>true for blocking sending; false for non-blocking sending. Default true.</td>
+ </tr>
+ <tr>
+ <td>UDT_RCVSYN</td>
+ <td>bool</td>
+ <td>synchronization mode for receiving.</td>
+ <td>true for blocking receiving; false for non-blocking receiving. Default true.</td>
+ </tr>
+ <tr>
+ <td>UDT_CC</td>
+ <td>CCCFactory*<br>CCC**</td>
+ <td>user defined congestion control algorithm.</td>
+ <td><i>optval</i> is a pointer to a CCC Factory class instance (for setsockopt).<br><i>optval</i> is a pointer of pointer to a CCC class instance (for getsockopt).</td>
+ </tr>
+ <tr>
+ <td>UDT_FC</td>
+ <td>int</td>
+ <td>Maximum window size (packets)</td>
+ <td>Default 25600.</td>
+ </tr>
+ <tr>
+ <td>UDT_SNDBUF</td>
+ <td>int</td>
+ <td>UDT sender buffer size limit (bytes)</td>
+ <td>Default 10MB (10240000).</td>
+ </tr>
+ <tr>
+ <td>UDT_RCVBUF</td>
+ <td>int</td>
+ <td>UDT receiver buffer size limit (bytes)</td>
+ <td>Default 10MB (10240000).</td>
+ </tr>
+ <tr>
+ <td>UDP_SNDBUF</td>
+ <td>int</td>
+ <td>UDP socket sender buffer size (bytes)</td>
+ <td>Default 1MB (1024000).</td>
+ </tr>
+ <tr>
+ <td>UDP_RCVBUF</td>
+ <td>int</td>
+ <td>UDP socket receiver buffer size (bytes)</td>
+ <td>Default 1MB (1024000).</td>
+ </tr>
+ <tr>
+ <td>UDT_LINGER</td>
+ <td>linger</td>
+ <td>Linger time on close().</td>
+ <td>Default 1 second.</td>
+ </tr>
+ <tr>
+ <td>UDT_RENDEZVOUS</td>
+ <td>bool</td>
+ <td>Rendezvous connection setup.</td>
+ <td>Default false (no rendezvous mode).</td>
+ </tr>
+ <tr>
+ <td>UDT_SNDTIMEO</td>
+ <td>int</td>
+ <td>sending call timeout (milliseconds).</td>
+ <td>Default -1 (infinite).</td>
+ </tr>
+ <tr>
+ <td>UDT_RCVTIMEO</td>
+ <td>int</td>
+ <td>receiving call timeout (milliseconds).</td>
+ <td>Default -1 (infinite).</td>
+ </tr>
+ <tr>
+ <td>UDT_REUSEADDR</td>
+ <td>bool</td>
+ <td>reuse an existing address or create a new one.</td>
+ <td>Default true (reuse).</td>
+ </tr>
+ </table>
+
+ <dt><em>optval</em></dt>
+ <dd>[in (set), out (get)] Pointer to the value of UDT option.</dd>
+ <dt><em>optlen</em></dt>
+ <dd>[in (set), in/out (get)] Pointer to the length of <i>optval</i>.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>On success, 0 is returned and proper UDT option is set or read; otherwise UDT::ERROR is returned and the specific error information can be retrieved using <a
+href="error.htm">getlasterror</a>.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>EBOUNDSOCK</td>
+ <td>5001</td>
+ <td>the sepecific option cannot be set on a bound socket.</td>
+ </tr>
+ <tr>
+ <td>ECONNSOCK</td>
+ <td>5002</td>
+ <td>the specific option cannot be set on a connected socket.</td>
+ </tr>
+ <tr>
+ <td>EINVPARAM</td>
+ <td>5003</td>
+ <td>the option value or length is invalid.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is an invalid UDT socket.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>the <strong>setsockopt</strong> method sets the UDT option <i>optName</i> with the value of <i>optval</i>. The parameter of <i>optlen</i> is checked to verify the goodness of the
+option value. Not all options can be set at any state of UDT. In fact, most options must be set before <strong>bind</strong> or <strong>connect</strong> is called, because these values
+are necessary to initialize certain data structures when a UDT connection is created.</p>
+
+<p>The <strong>getsockopt</strong> method reads the current option value. The value is written into the buffer pointed by <i>optval</i> and the length is returned in <i>optlen</i>.</p>
+
+<h5>Example</h5>
+To send data sending in non-blocking mode, the code can be like:
+<div class="code">
+UDTSOCKET u;<br>
+...<br>
+bool block = false;<br>
+UDT::setsockopt(u, 0, UDT_SNDSYN, &block, sizeof(bool));
+</div>
+
+<h5>See Also</h5>
+<p><strong><a href="t-config.htm">Configure UDT Options</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/peername.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/peername.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/peername.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,67 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>getpeername</strong></h4>
+<p>The <b>getpeername</b> method retrieves the address informtion of the peer side of a connected UDT socket.</p>
+
+<div class="code">int getpeername(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ struct sockaddr* <font color="#FFFFFF">name</font>,<br />
+ int* <font color="#FFFFFF">namelen</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a connected socket.</dd>
+ <dt><em>name</em></dt>
+ <dd>[out] The structure to store the address of the peer.</dd>
+ <dt><em>addrlen</em></dt>
+ <dd>[in, out] pointer to the size of the <i>name</i> structure.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>On success, <strong>getlasterror</strong> returns 0 and the peer address information is stored in <i>name</i>; otherwise it returns UDT::ERROR and the specific error information can be
+retrieved using <a href="error.htm">getlasterror</a>.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>ENOCONN</td>
+ <td>2002</td>
+ <td><i>u</i> is not connected.</td>
+ </tr>
+ <tr>
+ <td>EINVPARAM</td>
+ <td>5003</td>
+ <td>Invalid parameters.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is an invailid UDT socket.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>The <strong>getpeername</strong> retrieves the address of the peer side associated to the connection. The UDT socket must be connected at the time when this method is called. The
+<i>namelen</i> must provide the leangth of the <i>name</i> parameter, which should be enough to hold the address information. On return, <i>namelen</i> contains the length of the result.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="listen.htm">listen</a>, <a href="connect.htm">connect</a>, <a href="accept.htm">accept</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recv.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recv.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recv.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,84 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>recv</strong></h4>
+<p>The <b>recv</b> method reads certain amount of data into a local memory buffer.</p>
+
+<div class="code">int recv(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ char* <font color="#FFFFFF">buf</font>,<br />
+ int <font color="#FFFFFF">len</font>,<br />
+ int <font color="#FFFFFF">flags</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a connected socket.</dd>
+ <dt><em>buf</em></dt>
+ <dd>[out] The buffer used to store incoming data.</dd>
+ <dt><em>len</em></dt>
+ <dd>[in] Length of the buffer.</dd>
+ <dt><em>flags</em></dt>
+ <dd>[in] Ignored. For compatibility only.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>On success, <b>recv</b> returns the actual size of received data. Otherwise UDT::ERROR is returned and specific error information can be retrieved by <a
+href="error.htm">getlasterror</a>. If UDT_RCVTIMEO is set to a positive value, zero will be returned if no data is received before the timer expires.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>ECONNLOST</td>
+ <td>2001</td>
+ <td>connection has been broken and no data left in receiver buffer.</td>
+ </tr>
+ <tr>
+ <td>ENOCONN</td>
+ <td>2002</td>
+ <td><i>u</i> is not connected.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is not an valid socket.</td>
+ </tr>
+ <tr>
+ <td>EDGRAMILL</td>
+ <td>5010</td>
+ <td>cannot use <i>recv</i> in SOCK_DGRAM mode.</td>
+ </tr>
+ <tr>
+ <td>EASYNCRCV</td>
+ <td>6002</td>
+ <td><i>u</i> is non-blocking (UDT_RCVSYN = false) but no data is available.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>The <strong>recv</strong> method reads certain amount of data from the protocol buffer. If there is not enough data in the buffer, <strong>recv</strong> only reads the available data
+in the protocol buffer and returns the actual size of data received. However, <strong>recv</strong> will never read more data than the buffer size indicates by <i>len</i>.</p>
+<p>In blocking mode (default), <strong>recv</strong> waits until there is some data received into the receiver buffer. In non-blocking mode, <strong>recv</strong> returns immediately and
+returns error if no data available.</p>
+<p>If UDT_RCVTIMEO is set and the socket is in blocking mode, <strong>recv</strong> only waits a limited time specified by UDT_RCVTIMEO option. If there is still no data available when
+the timer expires, zero will be returned. UDT_RCVTIMEO has no effect for non-blocking socket.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="select.htm">select</a>, <a href="send.htm">send</a>, <a href="sendfile.htm">sendfile</a>, <a href="recvfile.htm">recvfile</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvfile.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvfile.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvfile.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>recvfile</strong></h4>
+<p>The <b>recvfile</b> method reads certain amount of data into a local file.</p>
+
+<div class="code">int64_t recvfile(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ ofstream& <font color="#FFFFFF">ofs</font>,<br />
+ int64_t <font color="#FFFFFF">offset</font>,<br />
+ int64_t <font color="#FFFFFF">size</font>,<br />
+ int <font color="#FFFFFF">block</font> = 366000<br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a connected socket.</dd>
+ <dt><em>ofs</em></dt>
+ <dd>[in] C++ ofstream descriptor for the file to store incoming data.</dd>
+ <dt><em>offset</em></dt>
+ <dd>[in] The offset position from where the data is written into the file.</dd>
+ <dt><em>size</em></dt>
+ <dd>[in] The total size to be received.</dd>
+ <dt><em>block</em></dt>
+ <dd>[in] Optional. The size of every data block for file IO.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>On success, <b>recvfile</b> returns the actual size of received data. Otherwise UDT::ERROR is returned and specific error information can be retrieved by <a
+href="error.htm">getlasterror</a>.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>ECONNLOST</td>
+ <td>2001</td>
+ <td>connection has been broken and no data left in receiver buffer.</td>
+ </tr>
+ <tr>
+ <td>ENOCONN</td>
+ <td>2002</td>
+ <td><i>u</i> is not connected.</td>
+ </tr>
+ <tr>
+ <td>EFILE</td>
+ <td>4000</td>
+ <td>File or disk system errors.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is not an valid socket.</td>
+ </tr>
+ <tr>
+ <td>EDGRAMILL</td>
+ <td>5010</td>
+ <td>cannot use <i>recvfile</i> in SOCK_DGRAM mode.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>The <strong>recvfile</strong> method reads certain amount of data and write it into a local file. It is always in blocking mode and will not return until the exact amount of data is
+received or the connection is broken. Neither UDT_RCVSYN nor UDT_RCVTIMEO affects this method.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="send.htm">send</a>, <a href="sendfile.htm">sendfile</a>, <a href="recv.htm">recv</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvmsg.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvmsg.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/recvmsg.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>recvmsg</strong></h4>
+<p>The <b>recvmsg</b> method receives a valid message.</p>
+
+<div class="code">int recvmsg(<br />
+ UDTSOCKET <font color="#FFFFFF">u</font>,<br />
+ char* <font color="#FFFFFF">msg</font>,<br />
+ int <font color="#FFFFFF">len</font><br />
+);</div>
+
+<h5>Parameters</h5>
+<dl>
+ <dt><i>u</i></dt>
+ <dd>[in] Descriptor identifying a connected socket.</dd>
+ <dt><em>msg</em></dt>
+ <dd>[out] The buffer used to store incoming message.</dd>
+ <dt><em>len</em></dt>
+ <dd>[in] Length of the buffer.</dd>
+</dl>
+
+<h5>Return Value</h5>
+<p>On success, <b>recvmsg</b> returns the actual size of received message. Otherwise UDT::ERROR is returned and specific error information can be retrieved by <a
+href="error.htm">getlasterror</a>. If UDT_RCVTIMEO is set to a positive value, zero will be returned if no message is received before the timer expires.</p>
+
+<table width="100%" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC">
+ <tr>
+ <td width="17%" class="table_headline"><strong>Error Name</strong></td>
+ <td width="17%" class="table_headline"><strong>Error Code</strong></td>
+ <td width="83%" class="table_headline"><strong>Comment</strong></td>
+ </tr>
+ <tr>
+ <td>ECONNLOST</td>
+ <td>2001</td>
+ <td>connection has been broken and no data left in receiver buffer.</td>
+ </tr>
+ <tr>
+ <td>ENOCONN</td>
+ <td>2002</td>
+ <td><i>u</i> is not connected.</td>
+ </tr>
+ <tr>
+ <td>EINVSOCK</td>
+ <td>5004</td>
+ <td><i>u</i> is not an valid socket.</td>
+ </tr>
+ <tr>
+ <td>ESTREAMILL</td>
+ <td>5009</td>
+ <td>cannot use <i>recvmsg</i> in SOCK_STREAM mode.</td>
+ </tr>
+ <tr>
+ <td>EASYNCRCV</td>
+ <td>6002</td>
+ <td><i>u</i> is non-blocking (UDT_RCVSYN = false) but no message is available.</td>
+ </tr>
+</table>
+
+<h5>Description</h5>
+<p>The <strong>recvmsg</strong> method reads a message from the protocol buffer. The UDT socket must be in SOCK_DGRAM mode in order to send or receive messages. Message is the minimum
+data unit in this situation. Each <strong>recvmsg</strong> will read no more than one message, even if the message is smaller than the size of <i>buf</i> and there
+are more messages available. On the other hand, if the <i>buf</i> is not enough to hold the first message, only part of the message will be copied into the buffer,
+but the message will still be discarded after this <strong>recvmsg</strong> call.</p>
+<p>In blocking mode (default), <strong>recvmsg</strong> waits until there is a valid message received into the receiver buffer. In non-blocking mode,
+strong>recvmsg</strong> returns immediately and returns error if no message available.</p>
+<p>If UDT_RCVTIMEO is set and the socket is in blocking mode, <strong>recvmsg</strong> only waits a limited time specified by UDT_RCVTIMEO option. If there is still
+no message available when the timer expires, zero will be returned. UDT_RCVTIMEO has no effect for non-blocking socket.</p>
+
+<h5>See Also</h5>
+<p><strong><a href="select.htm">select</a>, <a href="sendmsg.htm">send</a></strong></p>
+<p> </p>
+
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/reference.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/reference.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/reference.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,21 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Introduction</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<h3><font color="#000080">UDT Reference</font></h3>
+<p>This section describes in detail the UDT API, including:</p>
+
+<ul>
+ <li><a href="function.htm">UDT Socket Functions</a></li>
+ <li><a href="structure.htm">UDT Socket Structures</a></li>
+ <li><a href="ccc.htm">Congestion Control Base Class</a></li>
+ <li><a href="ecode.htm">UDT Error Code List</a></li>
+</ul>
+<p> </p>
+</body>
+</html>
Added: unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/select.htm
===================================================================
--- unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/select.htm (rev 0)
+++ unicorex/uas-udt/trunk/src/main/cplusplus/udt4/doc/doc/select.htm 2008-03-26 14:37:37 UTC (rev 2588)
@@ -0,0 +1,104 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title> UDT Reference</title>
+<link rel="stylesheet" href="udtdoc.css" type="text/css" />
+</head>
+
+<body>
+<div class="ref_head"> UDT Reference: Functions</div>
+
+<h4 class="func_name"><strong>select</strong></h4>
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|