Made some subtle changes to the way the static variables are instantiated in
[pwlib.git] / include / ptlib / ipdsock.h
blob9de39e5935020e8f7869a30b41e5decaff2cc2b8
1 /*
2 * ipdsock.h
4 * IP Datagram socket I/O channel class.
6 * Portable Windows Library
8 * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
10 * The contents of this file are subject to the Mozilla Public License
11 * Version 1.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
18 * under the License.
20 * The Original Code is Portable Windows Library.
22 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
24 * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25 * All Rights Reserved.
27 * Contributor(s): ______________________________________.
29 * $Log$
30 * Revision 1.10 2003/09/17 05:41:58 csoutheren
31 * Removed recursive includes
33 * Revision 1.9 2003/09/17 01:18:02 csoutheren
34 * Removed recursive include file system and removed all references
35 * to deprecated coooperative threading support
37 * Revision 1.8 2002/09/16 01:08:59 robertj
38 * Added #define so can select if #pragma interface/implementation is used on
39 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
41 * Revision 1.7 2001/05/22 12:49:32 robertj
42 * Did some seriously wierd rewrite of platform headers to eliminate the
43 * stupid GNU compiler warning about braces not matching.
45 * Revision 1.6 1999/03/09 02:59:49 robertj
46 * Changed comments to doc++ compatible documentation.
48 * Revision 1.5 1999/02/16 08:12:00 robertj
49 * MSVC 6.0 compatibility changes.
51 * Revision 1.4 1998/11/14 06:28:09 robertj
52 * Fixed error in documentation
54 * Revision 1.3 1998/09/23 06:20:43 robertj
55 * Added open source copyright license.
57 * Revision 1.2 1996/09/14 13:09:20 robertj
58 * Major upgrade:
59 * rearranged sockets to help support IPX.
60 * added indirect channel class and moved all protocols to descend from it,
61 * separating the protocol from the low level byte transport.
63 * Revision 1.1 1996/05/15 21:11:16 robertj
64 * Initial revision
68 #ifndef _PIPDATAGRAMSOCKET
69 #define _PIPDATAGRAMSOCKET
71 #ifdef P_USE_PRAGMA
72 #pragma interface
73 #endif
75 /** Internet Protocol Datagram Socket class.
77 class PIPDatagramSocket : public PIPSocket
79 PCLASSINFO(PIPDatagramSocket, PIPSocket);
80 protected:
81 /**Create a TCP/IP protocol socket channel. If a remote machine address or
82 a "listening" socket is specified then the channel is also opened.
84 PIPDatagramSocket();
87 public:
88 // New functions for class
89 /**Read a datagram from a remote computer.
91 @return TRUE if any bytes were sucessfully read.
93 virtual BOOL ReadFrom(
94 void * buf, /// Data to be written as URGENT TCP data.
95 PINDEX len, /// Number of bytes pointed to by #buf#.
96 Address & addr, /// Address from which the datagram was received.
97 WORD & port /// Port from which the datagram was received.
100 /**Write a datagram to a remote computer.
102 @return TRUE if all the bytes were sucessfully written.
104 virtual BOOL WriteTo(
105 const void * buf, /// Data to be written as URGENT TCP data.
106 PINDEX len, /// Number of bytes pointed to by #buf#.
107 const Address & addr, /// Address to which the datagram is sent.
108 WORD port /// Port to which the datagram is sent.
112 // Include platform dependent part of class
113 #ifdef _WIN32
114 #include "msos/ptlib/ipdsock.h"
115 #else
116 #include "unix/ptlib/ipdsock.h"
117 #endif
120 #endif
122 // End Of File ///////////////////////////////////////////////////////////////