VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlInetEndpoint.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 1992-2010 MAK Technologies, Inc
3 ** All rights reserved.
4 *********************************************************************/
8 #pragma once
9 
10 #include <vlutil/vlInet.h>
11 #include <vlutil/vlInetAddr.h>
12 #include <vlutil/vlInetAddrUtils.h>
13 #include <vlutil/vlString.h>
14 
15 
16 #ifdef DtUSE_UTILITIES_NAMESPACE
17 namespace DtUSE_UTILITIES_NAMESPACE
18 {
19 #endif
20 
23 {
27 };
28 
34 {
35 public:
36 
39 
49  // with. If addr specifies a remote unicast address, broadcast address, or
53  DtInetEndpoint( const DtInetAddr& addr, DtU16 port = 0,
55 
72  // with. If the network resource locator resolves to a remote unicast
76  DtInetEndpoint( DtString& netResLoc, DtU16 port = 0,
79 
81  virtual ~DtInetEndpoint();
82 
84  DtInetEndpoint( const DtInetEndpoint& orig );
85 
87  DtInetEndpoint& operator=(const DtInetEndpoint& orig);
88 
92  virtual void hostLookup( DtString& addr, DtU16 port = 0,
94 
98  virtual void setAddress( const DtInetAddr& addr );
99  virtual const DtInetAddr& address() const;
100 
104  virtual void setPort( DtU16 port );
105  virtual DtU16 port() const;
106 
112  virtual void setProtocol( DtInetProtocol protocol );
113  virtual DtInetProtocol protocol() const;
114 
116  virtual DtInetUtils::DtInetAddrFamily family() const;
117 
120  virtual void setEndpoint( DtInetProtocol protocol, const DtInetAddr& addr, DtU16 port );
121 
124  virtual bool isIPv4() const;
125  virtual bool isIPv6() const;
126  virtual bool isTcp() const;
127  virtual bool isUdp() const;
129 
133  virtual int toSockaddr( struct sockaddr_in* s );
134  virtual int toSockaddr( struct sockaddr_in6* s );
136 
146  virtual const DtString& toDtString( bool showProtocol = false ) const;
147 
150  virtual bool isOk();
151 
153  virtual DtString getLastErrorString();
154 
155 
157  virtual void* tcpEndpoint();
158  virtual void* udpEndpoint();
159 
162  friend DT_DLL_VLUTIL bool operator==( const DtInetEndpoint& ep1, const DtInetEndpoint& ep2 );
163  friend DT_DLL_VLUTIL bool operator!=( const DtInetEndpoint& ep1, const DtInetEndpoint& ep2 );
164  friend DT_DLL_VLUTIL bool operator<( const DtInetEndpoint& ep1, const DtInetEndpoint& ep2 );
165  friend DT_DLL_VLUTIL bool operator>( const DtInetEndpoint& ep1, const DtInetEndpoint& ep2 );
166 // virtual bool operator==( const DtInetEndpoint& addr );
168 
169 protected:
170  void initEndpoint();
171 
172 protected:
175 
179 
180  bool myError;
182 
189 
191 
192 };
193 // end of class DtInetEndpoint
194 
195 #ifdef DtUSE_UTILITIES_NAMESPACE
196 }
197 #endif
198 
const bool operator==(const DtU128 &lhs, const DtU128 &rhs)
Definition: vlInetAddrUtils.h:58
DtInetAddr myAddr
Definition: vlInetEndpoint.h:176
Definition: vlInetEndpoint.h:25
Definition: vlInetAddrUtils.h:60
Contains the DtString class declaration.
DtString myLastErrorString
Definition: vlInetEndpoint.h:181
DtString myMutableFullString
Definition: vlInetEndpoint.h:188
void * myTcpEndpoint
Definition: vlInetEndpoint.h:173
DtU16 myPort
Definition: vlInetEndpoint.h:177
bool myError
Definition: vlInetEndpoint.h:180
DtInetAddrFamily
Definition: vlInetAddrUtils.h:55
bool myMutableStringsInitialized
These are mutable so that the string can be initialized only if needed, but may then be stored to avo...
Definition: vlInetEndpoint.h:186
The DtInetEndpoint class provides a protocol independant, address family independent mechanism to rep...
Definition: vlInetEndpoint.h:33
Represents a IPv4 or IPv6 address.
Definition: vlInetAddr.h:36
This file declares useful defaults constants and static methods for IP address handling.
Definition: vlInetEndpoint.h:26
DtString myMutableShortString
Definition: vlInetEndpoint.h:187
This file contains the declaration of the DtInetAddr class.
DtInetProtocol
Specifies the protocol used by the endpoint.
Definition: vlInetEndpoint.h:22
unsigned short DtU16
A 16 bit unsigned integer value.
Definition: vlMachineTypes.h:140
DtInetProtocol myProtocol
Definition: vlInetEndpoint.h:178
const bool operator!=(const DtU128 &lhs, const DtU128 &rhs)
Definition: vlInetEndpoint.h:24
void * myUdpEndpoint
Definition: vlInetEndpoint.h:174
Instances of DtString are used to represent strings.
Definition: vlString.h:29
const bool operator<(const DtU128 &lhs, const DtU128 &rhs)
DtString myNodeName
Definition: vlInetEndpoint.h:190
const bool operator>(const DtU128 &lhs, const DtU128 &rhs)
This file declares useful defaults constants and static methods employed with the networking abstract...
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109

Document ID: Generated on Wed Mar 27 02:04:30 EDT 2024 from SVN revision 264570
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)