diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-10 19:59:37 +0000 |
commit | 3df4acfa816441fc28a95dee6d0191a927145d95 (patch) | |
tree | b5ae7ca44662cfd8e5c95f1826e4406021a606f5 /examples/QOS/Diffserv | |
parent | 60a5612b83d856fc0adc52b9f39fac9960ec9818 (diff) | |
download | ATCD-pre-subset.tar.gz |
This commit was manufactured by cvs2svn to create tag 'pre-subset'.pre-subset
Diffstat (limited to 'examples/QOS/Diffserv')
-rw-r--r-- | examples/QOS/Diffserv/Diffserv.dsw | 41 | ||||
-rw-r--r-- | examples/QOS/Diffserv/Makefile | 35 | ||||
-rw-r--r-- | examples/QOS/Diffserv/NOTES.txt | 58 | ||||
-rw-r--r-- | examples/QOS/Diffserv/README | 107 | ||||
-rw-r--r-- | examples/QOS/Diffserv/diffserv_test.cpp | 133 | ||||
-rw-r--r-- | examples/QOS/Diffserv/diffserv_test.dsp | 115 | ||||
-rwxr-xr-x | examples/QOS/Diffserv/run_test.pl | 40 | ||||
-rw-r--r-- | examples/QOS/Diffserv/server.cpp | 163 | ||||
-rw-r--r-- | examples/QOS/Diffserv/server.dsp | 115 |
9 files changed, 0 insertions, 807 deletions
diff --git a/examples/QOS/Diffserv/Diffserv.dsw b/examples/QOS/Diffserv/Diffserv.dsw deleted file mode 100644 index 450a10e0f46..00000000000 --- a/examples/QOS/Diffserv/Diffserv.dsw +++ /dev/null @@ -1,41 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "Examples Misc diffserv_test"=.\diffserv_test.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "Examples Misc server"=.\server.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/examples/QOS/Diffserv/Makefile b/examples/QOS/Diffserv/Makefile deleted file mode 100644 index cba0ef6f817..00000000000 --- a/examples/QOS/Diffserv/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# $Id$ - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -BIN = diffserv_test server - -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VBIN) - -LSRC=$(addsuffix .cpp,$(BIN)) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. diff --git a/examples/QOS/Diffserv/NOTES.txt b/examples/QOS/Diffserv/NOTES.txt deleted file mode 100644 index 4e73c66af0f..00000000000 --- a/examples/QOS/Diffserv/NOTES.txt +++ /dev/null @@ -1,58 +0,0 @@ -# $Id$ - -Linux notes -=========== - -Under Linux kernel 2.4, the following DSCP values -could not be set with the setsockopt call -unless you run as root: - -EF, CS5, CS6, CS7 - -Also, under Linux 2.4.2 kernel, if I could successfully -set the 2 bits reserved for ECN in the Diffserv Field to -0x00 or 0x02. However, the setsockopt call would -fail if it was set to 0x01 or 0x03. - -According to the Linux Diffserv mailing list: -http://diffserv.sourceforge.net -http://www.geocrawler.com/archives/3/11111/2001/10/0/6761099/ - -=========================================================================== -On Fri, Oct 05, 2001 at 08:18:06AM +0300, Pekka Savola wrote: -> On Tue, 2 Oct 2001, Craig Rodrigues wrote: -> > Can someone shed some light as to why I got this -> > error under Linux? Is it configuration problem, -> > or is there some sort of policy decision in the kernel that -> > requires the process to be run as root when setting -> > those DSCP values? -> -> A part of DSCP field was previously Precedence. -> -> Linux has required that in order to use 'Critical' or higher Precedence, -> one must have CAP_NET_ADMIN capability, in most cases, root. -> -> I'm not one to say whether this restriction should be removed. Perhaps. -> -> -- -> Pekka Savola "Tell me of difficulties surmounted, -> Netcore Oy not those you stumble over and fall" -> Systems. Networks. Security. -- Robert Jordan: A Crown of Swords -> -=========================================================================== - -FreeBSD notes -============= -Under FreeBSD 4.3, I encountered no problems -setting DSCP or ECN values, and I could set all -these values without being root. -However, FreeBSD seems to be more fussy about the size of the parameter -you pass into the setsockopt call. Make sure you get the -size right, and cast it properly, ie. don't cast a short, or some -other size. - - -Solaris notes -============= -No problems setting DSCP or ECN values. - diff --git a/examples/QOS/Diffserv/README b/examples/QOS/Diffserv/README deleted file mode 100644 index 285d514ad12..00000000000 --- a/examples/QOS/Diffserv/README +++ /dev/null @@ -1,107 +0,0 @@ -This directory contains an example which -tests the setting of the Diffserv Codepoint (DSCP) -values in the -IP TOS field of a stream of UDP packets. - -Running the example -=================== - -(1) On one host, run: - server [UDP port number] - - If port number is omitted, a default port number of 20002 - is used. - -(2) On a second host, run: - diffserv_test [destination host] [destination port] - - The host and port of where the server is running should - be specified. - - A stream of UDP packets will be sent from to the server, - with various codepoints set. - -(3) Look at the Diffserv Field (formerly known as the TOS field) - of your packets, using a protocol analyzer, such as Ethereal. - - - - -Introduction -============ -In RFC 2474, the Type of Service (TOS) field in -the IP header was renamed the Diffserv (DS) field. -The DS field is one octet (8 bits). - - 0 1 2 3 4 5 6 7 - +---+---+---+---+---+---+---+---+ - | DSCP | ECN | - +---+---+---+---+---+---+---+---+ - -The first 6 bits of the field are -reserved for the Diffserv Codepoint (DSCP). -There are 64 possible values (0-63) for the DSCP. - -Bits 6 and 7 of the DS field are reserved -for Explicit Congestion Notification (ECN). -ECN is defined in RFC 3168. - - -Per-Hop Behaviors (PHB) -======================= - -A Per-Hop Behavior (PHB) is a description of the externally -observable forwarding treatment applied at a differentiated -services compliant node. - -Certain PHB's are defined in RFC's and associated with -different DSCP values. Other values are undefined and left -for experimentation. Please refer to the RFC's for a full -explanation of the attributes of the various PHB's. - - -DSCP value PHB RFC -(binary) ------------------------------------------------------------ -000000 Default (Best Effort) 2474 -001000 Class Selector (CS1) 2474 -010000 Class Selector (CS2) 2474 -011000 Class Selector (CS3) 2474 -100000 Class Selector (CS4) 2474 -101000 Class Selector (CS5) 2474 -110000 Class Selector (CS6) 2474 -111000 Class Selector (CS7) 2474 -001010 Assured Forwarding (AF11) 2597 -001100 Assured Forwarding (AF12) 2597 -001110 Assured Forwarding (AF13) 2597 -010010 Assured Forwarding (AF21) 2597 -010100 Assured Forwarding (AF22) 2597 -010110 Assured Forwarding (AF23) 2597 -011010 Assured Forwarding (AF31) 2597 -011100 Assured Forwarding (AF32) 2597 -011110 Assured Forwarding (AF33) 2597 -100010 Assured Forwarding (AF41) 2597 -100100 Assured Forwarding (AF42) 2597 -100110 Assured Forwarding (AF43) 2597 -101110 Expedited Forwarding (EF) 2598 - - -References -========== -RFC 2474, "Definition of the Differentiated Services (DS Field) - in the IPv4 and IPv6 Headers", http://www.ietf.org/rfc/rfc2474.txt - -RFC 2475, "An Architecture for Differentiated Services", - http://www.ietf.org/rfc/rfc2475.txt - -RFC 2597, "Assured Forwarding PHB Group", http://www.ietf.org/rfc/rfc2597.txt - -RFC 3246, "An Expedited Forwarding PHB", http://www.ietf.org/rfc/rfc3246.txt - -RFC 3247, "Supplemental Information for the New Definition of the EF PHB", - http://www.ietf.org/rfc/rfc3247.txt - -RFC 3168, "The Addition of Explicit Congestion Notification (ECN) - to IP", http://www.ietf.org/rfc/rfc3168.txt - -Ethereal, http://www.ethereal.com diff --git a/examples/QOS/Diffserv/diffserv_test.cpp b/examples/QOS/Diffserv/diffserv_test.cpp deleted file mode 100644 index ac3acc2ed8f..00000000000 --- a/examples/QOS/Diffserv/diffserv_test.cpp +++ /dev/null @@ -1,133 +0,0 @@ -//============================================================================= -/** - * @file diffserv_test.cpp - * - * $Id$ - * - * @author Craig Rodrigues <crodrigu@bbn.com> - * @brief Send UDP packets to a destination host and port. - * Change the Diffserv field to various values. - */ -//============================================================================= - -#include "ace/Log_Msg.h" -#include "ace/SOCK_CODgram.h" -#include "ace/INET_Addr.h" - -#define IPDSFIELD_DSCP_DEFAULT 0x00 -#define IPDSFIELD_DSCP_CS1 0x08 -#define IPDSFIELD_DSCP_CS2 0x10 -#define IPDSFIELD_DSCP_CS3 0x18 -#define IPDSFIELD_DSCP_CS4 0x20 -#define IPDSFIELD_DSCP_CS5 0x28 -#define IPDSFIELD_DSCP_CS6 0x30 -#define IPDSFIELD_DSCP_CS7 0x38 -#define IPDSFIELD_DSCP_AF11 0x0A -#define IPDSFIELD_DSCP_AF12 0x0C -#define IPDSFIELD_DSCP_AF13 0x0E -#define IPDSFIELD_DSCP_AF21 0x12 -#define IPDSFIELD_DSCP_AF22 0x14 -#define IPDSFIELD_DSCP_AF23 0x16 -#define IPDSFIELD_DSCP_AF31 0x1A -#define IPDSFIELD_DSCP_AF32 0x1C -#define IPDSFIELD_DSCP_AF33 0x1E -#define IPDSFIELD_DSCP_AF41 0x22 -#define IPDSFIELD_DSCP_AF42 0x24 -#define IPDSFIELD_DSCP_AF43 0x26 -#define IPDSFIELD_DSCP_EF 0x2E -#define IPDSFIELD_ECT_MASK 0x02 -#define IPDSFIELD_CE_MASK 0x01 - -int dscp [] = - { - IPDSFIELD_DSCP_DEFAULT , - IPDSFIELD_DSCP_CS1 , - IPDSFIELD_DSCP_CS2 , - IPDSFIELD_DSCP_CS3 , - IPDSFIELD_DSCP_CS4 , - IPDSFIELD_DSCP_CS5 , - IPDSFIELD_DSCP_CS6 , - IPDSFIELD_DSCP_CS7 , - IPDSFIELD_DSCP_AF11 , - IPDSFIELD_DSCP_AF12 , - IPDSFIELD_DSCP_AF13 , - IPDSFIELD_DSCP_AF21 , - IPDSFIELD_DSCP_AF22 , - IPDSFIELD_DSCP_AF23 , - IPDSFIELD_DSCP_AF31 , - IPDSFIELD_DSCP_AF32 , - IPDSFIELD_DSCP_AF33 , - IPDSFIELD_DSCP_AF41 , - IPDSFIELD_DSCP_AF42 , - IPDSFIELD_DSCP_AF43 , - IPDSFIELD_DSCP_EF - }; - -const char *dscp_char[]= - { - "Normal", - "CS1", - "CS2", - "CS3", - "CS4", - "CS5", - "CS6", - "CS7", - "Assured Forwarding 11", - "Assured Forwarding 12", - "Assured Forwarding 13", - "Assured Forwarding 21", - "Assured Forwarding 22", - "Assured Forwarding 23", - "Assured Forwarding 31", - "Assured Forwarding 32", - "Assured Forwarding 33", - "Assured Forwarding 41", - "Assured Forwarding 42", - "Assured Forwarding 43", - "Expedited Forwarding" - }; - -int -main(int argc , char *argv[]) -{ - - if(argc != 3) - { - ACE_DEBUG((LM_DEBUG, "Usage:\n %s [destination host] [destination port]\n\n", argv[0])); - ACE_OS::exit(1); - } - - - char *buf = (char *)ACE_OS::malloc(20 * sizeof(char)); - ACE_OS::strcpy(buf, "Hello"); - - ACE_SOCK_CODgram sock; - ACE_INET_Addr raddr(ACE_OS::atoi(argv[2]), argv[1]); - - sock.open( raddr, ACE_Addr::sap_any, PF_INET, 0, 1); - int opt=0; - int ret =0, ret2=0; - unsigned int i; - for(i=0; i < 21; i++) - { - opt = dscp[i] << 2; - ret = sock.set_option(IPPROTO_IP, IP_TOS, (int *)&opt, (int)sizeof(opt) ); - if(ret == -1){ - ACE_DEBUG((LM_DEBUG, "setsockopt error: %m\n")); - } - - for (int j=0; j<3; j++) - { - ret2 = sock.send(buf, ACE_OS::strlen(buf)); - if(ret2 == -1){ - ACE_DEBUG((LM_DEBUG, "send error: %m\n")); - } - printf("opt: %u dscp: %u, %s, setsockopt returned: %d, send returned: %d\n", opt, opt >> 2, dscp_char[i], ret, ret2); - ACE_OS::sleep(1); - } - } - - ACE_OS::free(buf); - return 0; -} diff --git a/examples/QOS/Diffserv/diffserv_test.dsp b/examples/QOS/Diffserv/diffserv_test.dsp deleted file mode 100644 index bc7dbedbfaf..00000000000 --- a/examples/QOS/Diffserv/diffserv_test.dsp +++ /dev/null @@ -1,115 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Examples Misc diffserv_test" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=Examples Misc diffserv_test - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "diffserv_test.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "diffserv_test.mak" CFG="Examples Misc diffserv_test - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Examples Misc diffserv_test - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "Examples Misc diffserv_test - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Examples Misc diffserv_test - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release\diffserv_test"
-# PROP BASE Intermediate_Dir "Release\diffserv_test"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release\diffserv_test"
-# PROP Intermediate_Dir "Release\diffserv_test"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
-# ADD CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c /D "NDEBUG" /O2 /MD /I "../../../"
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 /nologo /subsystem:console /machine:I386 ../../../ace/ACE.lib /out:"diffserv_test.exe"
-
-!ELSEIF "$(CFG)" == "Examples Misc diffserv_test - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ""
-# PROP BASE Intermediate_Dir "Debug\diffserv_test"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug\diffserv_test"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c /Gm /Zi
-# ADD CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c /Gm /Zi /D "_DEBUG" /Od /MDd /I "../../../"
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /debug /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /debug /pdbtype:sept ../../../ace/ACEd.lib /out:"diffserv_test.exe"
-
-!ENDIF
-
-# Begin Target
-
-# Name "Examples Misc diffserv_test - Win32 Release"
-# Name "Examples Misc diffserv_test - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\diffserv_test.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;fi;fd"
-# End Group
-# Begin Group "IDL Files"
-
-# PROP Default_Filter "idl;pidl"
-# End Group
-# Begin Group "Inline Files"
-
-# PROP Default_Filter "inl;i"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/examples/QOS/Diffserv/run_test.pl b/examples/QOS/Diffserv/run_test.pl deleted file mode 100755 index aef0765bac8..00000000000 --- a/examples/QOS/Diffserv/run_test.pl +++ /dev/null @@ -1,40 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; - -$iorfile = PerlACE::LocalFile ("ior"); - -unlink $iorfile; -$status = 0; - -$CL = new PerlACE::Process ("diffserv_test", "localhost 20002"); -$SV = new PerlACE::Process ("server"); - -$server = $SV->Spawn (); -$SV->TimedWait(2); - -$client = $CL->SpawnWaitKill (200); - -if ($client != 0) { - $time = localtime; - print STDERR "ERROR: client returned $client at $time\n"; - $status = 1; -} - -$server = $SV->WaitKill (400); - -if ($server != 0) { - $time = localtime; - print STDERR "ERROR: server returned $server at $time\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/examples/QOS/Diffserv/server.cpp b/examples/QOS/Diffserv/server.cpp deleted file mode 100644 index 2c082cdc1e7..00000000000 --- a/examples/QOS/Diffserv/server.cpp +++ /dev/null @@ -1,163 +0,0 @@ -//============================================================================= -/** - * @file server.cpp - * - * $Id$ - * - * @author Craig Rodrigues <crodrigu@bbn.com> - * @brief Start a server which listens for UDP packets on a specified port. - */ -//============================================================================= - -#include "ace/Reactor.h" -#include "ace/Process.h" -#include "ace/SOCK_Dgram.h" -#include "ace/INET_Addr.h" -#include "ace/Log_Msg.h" - -// Port used to receive for dgrams. -static u_short port1; - -class Dgram_Endpoint : public ACE_Event_Handler -{ -public: - Dgram_Endpoint (const ACE_INET_Addr &local_addr); - - // = Hook methods inherited from the <ACE_Event_Handler>. - virtual ACE_HANDLE get_handle (void) const; - virtual int handle_input (ACE_HANDLE handle); - virtual int handle_timeout (const ACE_Time_Value & tv, - const void *arg = 0); - virtual int handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask close_mask); - - int send (const char *buf, size_t len, const ACE_INET_Addr &); - // Send the <buf> to the peer. - -private: - ACE_SOCK_Dgram endpoint_; - // Wrapper for sending/receiving dgrams. -}; - -int -Dgram_Endpoint::send (const char *buf, - size_t len, - const ACE_INET_Addr &addr) -{ - return this->endpoint_.send (buf, len, addr); -} - -Dgram_Endpoint::Dgram_Endpoint (const ACE_INET_Addr &local_addr) - : endpoint_ (local_addr) -{ -} - -ACE_HANDLE -Dgram_Endpoint::get_handle (void) const -{ - return this->endpoint_.get_handle (); -} - -int -Dgram_Endpoint::handle_close (ACE_HANDLE handle, - ACE_Reactor_Mask) -{ - ACE_UNUSED_ARG (handle); - - this->endpoint_.close (); - delete this; - return 0; -} - -int -Dgram_Endpoint::handle_input (ACE_HANDLE) -{ - char buf[BUFSIZ]; - ACE_INET_Addr from_addr; - - ssize_t n = this->endpoint_.recv (buf, - sizeof buf, - from_addr); - - if (n == -1) - ACE_ERROR ((LM_ERROR, - "%p\n", - "handle_input")); - else - { - buf[n] = 0; - ACE_DEBUG ((LM_DEBUG, - "Received buf of size %d = %s\n", - n, - buf)); - } - return 0; -} - -int -Dgram_Endpoint::handle_timeout (const ACE_Time_Value &, - const void *) -{ - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) timed out for endpoint\n")); - return 0; -} - -static int -run_test (u_short localport) -{ - ACE_INET_Addr local_addr (localport); - - Dgram_Endpoint *endpoint; - - ACE_NEW_RETURN (endpoint, - Dgram_Endpoint (local_addr), - -1); - - ACE_DEBUG((LM_DEBUG, "Starting server on port %d\n",port1)); - - // Read data from other side. - if (ACE_Reactor::instance ()->register_handler - (endpoint, - ACE_Event_Handler::READ_MASK) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "ACE_Reactor::register_handler"), - -1); - - int ret; - while(1){ - ACE_Time_Value tv(10, 0); - ret = ACE_Reactor::instance ()->handle_events (&tv); - /* Error occurred while handling event */ - if (ret < 0) - { - ACE_ERROR_RETURN ((LM_DEBUG, - "(%P|%t) %p\n", - "handle_events"), - -1); - } - /* We have timed out without handling an event, break out of loop */ - if(ret == 0) break; - } - - return 0; -} - -int -main (int argc, char *argv[]) -{ - // Estabish call backs and socket names. - - port1 = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT; - - if(argc < 3) - { - run_test (port1); - } - else{ - ACE_DEBUG((LM_DEBUG, "\nUsage:\n %s [port number]\n", argv[0])); - return -1; - } - - return 0; -} diff --git a/examples/QOS/Diffserv/server.dsp b/examples/QOS/Diffserv/server.dsp deleted file mode 100644 index a30d868a8e7..00000000000 --- a/examples/QOS/Diffserv/server.dsp +++ /dev/null @@ -1,115 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Examples Misc server" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=Examples Misc server - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "server.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "server.mak" CFG="Examples Misc server - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "Examples Misc server - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "Examples Misc server - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Examples Misc server - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release\server"
-# PROP BASE Intermediate_Dir "Release\server"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release\server"
-# PROP Intermediate_Dir "Release\server"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c
-# ADD CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c /D "NDEBUG" /O2 /MD /I "../../../"
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 /nologo /subsystem:console /machine:I386 ../../../ace/ACE.lib /out:"server.exe"
-
-!ELSEIF "$(CFG)" == "Examples Misc server - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ""
-# PROP BASE Intermediate_Dir "Debug\server"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ""
-# PROP Intermediate_Dir "Debug\server"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c /Gm /Zi
-# ADD CPP /nologo /W3 /GX /D "WIN32" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /FD /c /Gm /Zi /D "_DEBUG" /Od /MDd /I "../../../"
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /debug /pdbtype:sept
-# ADD LINK32 /nologo /subsystem:console /machine:I386 /debug /pdbtype:sept ../../../ace/ACEd.lib /out:"server.exe"
-
-!ENDIF
-
-# Begin Target
-
-# Name "Examples Misc server - Win32 Release"
-# Name "Examples Misc server - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\server.cpp
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;fi;fd"
-# End Group
-# Begin Group "IDL Files"
-
-# PROP Default_Filter "idl;pidl"
-# End Group
-# Begin Group "Inline Files"
-
-# PROP Default_Filter "inl;i"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
|