VR-Link API Documentation for HLA 1516
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
include
vlutil
vlInetEndpoint.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1992-2010 VT MAK
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
22
enum
DtInetProtocol
23
{
24
DtInetProtocol_UDP
= 0,
25
DtInetProtocol_TCP
= 1,
26
DtInetProtocol_Unspecified
= 99
27
};
28
33
class
DT_DLL_VLUTIL
DtInetEndpoint
34
{
35
public
:
36
38
DtInetEndpoint
();
39
49
// with. If addr specifies a remote unicast address, broadcast address, or
53
DtInetEndpoint
(
const
DtInetAddr
& addr,
DtU16
port = 0,
54
DtInetProtocol
protocol =
DtInetProtocol_Unspecified
);
55
72
// with. If the network resource locator resolves to a remote unicast
76
DtInetEndpoint
(
DtString
& netResLoc,
DtU16
port = 0,
77
DtInetProtocol
protocol =
DtInetProtocol_Unspecified
,
78
DtInetUtils::DtInetAddrFamily
familyHint =
DtInetUtils::DtInetAddrFamily_IPv4
);
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,
93
DtInetUtils::DtInetAddrFamily
familyHint =
DtInetUtils::DtInetAddrFamily_Both
);
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
:
173
void
*
myTcpEndpoint
;
174
void
*
myUdpEndpoint
;
175
176
DtInetAddr
myAddr
;
177
DtU16
myPort
;
178
DtInetProtocol
myProtocol
;
179
180
bool
myError
;
181
DtString
myLastErrorString
;
182
186
mutable
bool
myMutableStringsInitialized
;
187
mutable
DtString
myMutableShortString
;
188
mutable
DtString
myMutableFullString
;
189
190
DtString
myNodeName
;
191
192
};
193
// end of class DtInetEndpoint
194
195
#ifdef DtUSE_UTILITIES_NAMESPACE
196
}
197
#endif
198
Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)