ReactOS 0.4.15-dev-7942-gd23573b
TCPSocketObject Class Reference
Inheritance diagram for TCPSocketObject:
Collaboration diagram for TCPSocketObject:

Public Member Functions

 TCPSocketObject (std::string host, int port, NTSTATUS *status)
 
 ~TCPSocketObject ()
 
int send (char *buf, int len, int *bytes, struct sockaddr_in *si)
 
int recv (char *buf, int len, int *bytes, struct sockaddr_in *si)
 
- Public Member Functions inherited from SocketObject
virtual ~SocketObject ()
 
virtual int send (char *buf, int len, int *bytes, struct sockaddr_in *si)=0
 
virtual int recv (char *buf, int len, int *bytes, struct sockaddr_in *si)=0
 

Private Attributes

PCONNECTION_ENDPOINT Connection
 

Detailed Description

Definition at line 188 of file iptest.cpp.

Constructor & Destructor Documentation

◆ TCPSocketObject()

TCPSocketObject::TCPSocketObject ( std::string  host,
int  port,
NTSTATUS status 
)
inline

Definition at line 190 of file iptest.cpp.

190 {
191 TA_IP_ADDRESS ConnectTo;
193
194 ConnectTo.TAAddressCount = 1;
195 ConnectTo.Address[0].AddressLength = sizeof(TDI_ADDRESS_IP);
196 ConnectTo.Address[0].AddressType = TDI_ADDRESS_TYPE_IP;
197 ConnectTo.Address[0].Address[0].sin_port = htons(port);
198 ConnectTo.Address[0].Address[0].in_addr = 0x6a020a0a;
199
200 TdiBuildConnectionInfo( &ConnInfo, (PTA_ADDRESS)&ConnectTo );
201
204 AF_INET,
206 if( !*status )
208 ConnInfo,
209 NULL,
211 NULL );
212 }
PCONNECTION_ENDPOINT Connection
Definition: iptest.cpp:244
#define NULL
Definition: types.h:112
USHORT port
Definition: uri.c:228
#define IPPROTO_TCP
Definition: ip.h:196
#define SOCK_STREAM
Definition: tcpip.h:118
#define AF_INET
Definition: tcpip.h:117
NTSTATUS TCPSocket(PCONNECTION_ENDPOINT Connection, UINT Family, UINT Type, UINT Proto)
Definition: tcp.c:153
NTSTATUS TCPConnect(PCONNECTION_ENDPOINT Connection, PTDI_CONNECTION_INFORMATION ConnInfo, PTDI_CONNECTION_INFORMATION ReturnInfo, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
Definition: tcp.c:302
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint(PVOID ClientContext)
Definition: tcp.c:107
void connect_complete(void *context, NTSTATUS status, unsigned long count)
Definition: iptest.cpp:56
NTSTATUS TdiBuildConnectionInfo(PTDI_CONNECTION_INFORMATION *ConnectionInfo, PTA_ADDRESS Address)
Definition: iptest.cpp:177
#define htons(x)
Definition: module.h:215
struct _TA_ADDRESS_IP::_AddrIp Address[1]
LONG TAAddressCount
Definition: tdi.h:523
Definition: ps.c:97
struct _TDI_ADDRESS_IP TDI_ADDRESS_IP
#define TDI_ADDRESS_TYPE_IP
Definition: tdi.h:345

◆ ~TCPSocketObject()

TCPSocketObject::~TCPSocketObject ( )
inline

Definition at line 214 of file iptest.cpp.

214 {
217 }
VOID TCPFreeConnectionEndpoint(PCONNECTION_ENDPOINT Connection)
NTSTATUS TCPClose(PCONNECTION_ENDPOINT Connection)
Definition: tcp.c:177

Member Function Documentation

◆ recv()

int TCPSocketObject::recv ( char buf,
int  len,
int bytes,
struct sockaddr_in si 
)
inlinevirtual

Implements SocketObject.

Definition at line 231 of file iptest.cpp.

231 {
233
234 if( Connection )
236 buf,
237 len,
238 (PULONG)bytes,
239 0 );
240 return Status;
241 }
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:25
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
NTSTATUS TCPSendData(PCONNECTION_ENDPOINT Connection, PCHAR Buffer, ULONG DataSize, PULONG DataUsed, ULONG Flags, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
Definition: tcp.c:580
uint32_t * PULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

◆ send()

int TCPSocketObject::send ( char buf,
int  len,
int bytes,
struct sockaddr_in si 
)
inlinevirtual

Implements SocketObject.

Definition at line 219 of file iptest.cpp.

219 {
221
222 if( Connection )
224 buf,
225 len,
226 (PULONG)bytes,
227 0 );
228 return Status;
229 }

Member Data Documentation

◆ Connection

PCONNECTION_ENDPOINT TCPSocketObject::Connection
private

Definition at line 244 of file iptest.cpp.

Referenced by recv(), send(), TCPSocketObject(), and ~TCPSocketObject().


The documentation for this class was generated from the following file: