Logo
~Sockets~
~Examples~
~Contact~


udpserver.cpp

Go to the documentation of this file.
00001 #include <StdoutLog.h>
00002 #include <SocketHandler.h>
00003 #include "UdpTestSocket.h"
00004 
00005 
00006 int main(int argc,char *argv[])
00007 {
00008         SocketHandler h;
00009         StdoutLog log;
00010         h.RegStdLog(&log);
00011         UdpTestSocket s(h);
00012         port_t port = 5000;
00013 
00014         if (s.Bind(port, 10) == -1)
00015         {
00016                 printf("Exiting...\n");
00017                 exit(-1);
00018         }
00019         else
00020         {
00021                 printf("Ready to receive on port %d\n",port);
00022         }
00023         h.Add(&s);
00024         h.Select(1,0);
00025         while (h.GetCount())
00026         {
00027                 h.Select(1,0);
00028         }
00029 }
00030 
00031 
Page, code, and content Copyright (C) 2006 by Anders Hedström
Generated on Mon Aug 29 20:21:47 2005 for C++ Sockets by  doxygen 1.4.4