ReactOS  0.4.14-dev-98-gb0d4763
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 ()
 

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  }
NTSTATUS TCPConnect(PCONNECTION_ENDPOINT Connection, PTDI_CONNECTION_INFORMATION ConnInfo, PTDI_CONNECTION_INFORMATION ReturnInfo, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
Definition: tcp.c:277
LONG TAAddressCount
Definition: tdi.h:523
NTSTATUS TCPSocket(PCONNECTION_ENDPOINT Connection, UINT Family, UINT Type, UINT Proto)
Definition: tcp.c:125
PCONNECTION_ENDPOINT Connection
Definition: iptest.cpp:244
smooth NULL
Definition: ftsmooth.c:416
struct _TA_ADDRESS_IP::_AddrIp Address[1]
#define TDI_ADDRESS_TYPE_IP
Definition: tdi.h:345
struct _TDI_ADDRESS_IP TDI_ADDRESS_IP
void connect_complete(void *context, NTSTATUS status, unsigned long count)
Definition: iptest.cpp:56
#define AF_INET
Definition: tcpip.h:117
#define SOCK_STREAM
Definition: tcpip.h:118
#define htons(x)
Definition: module.h:213
NTSTATUS TdiBuildConnectionInfo(PTDI_CONNECTION_INFORMATION *ConnectionInfo, PTA_ADDRESS Address)
Definition: iptest.cpp:177
USHORT port
Definition: uri.c:227
PCONNECTION_ENDPOINT TCPAllocateConnectionEndpoint(PVOID ClientContext)
Definition: tcp.c:86
Definition: ps.c:97

◆ ~TCPSocketObject()

TCPSocketObject::~TCPSocketObject ( )
inline

Definition at line 214 of file iptest.cpp.

214  {
215  TCPClose( Connection );
217  }
PCONNECTION_ENDPOINT Connection
Definition: iptest.cpp:244
NTSTATUS TCPClose(PCONNECTION_ENDPOINT Connection)
Definition: tcp.c:150
VOID TCPFreeConnectionEndpoint(PCONNECTION_ENDPOINT Connection)

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  }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS TCPSendData(PCONNECTION_ENDPOINT Connection, PCHAR Buffer, ULONG DataSize, PULONG DataUsed, ULONG Flags, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
Definition: tcp.c:525
PCONNECTION_ENDPOINT Connection
Definition: iptest.cpp:244
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
GLenum GLsizei len
Definition: glext.h:6722
Status
Definition: gdiplustypes.h:24
unsigned int * PULONG
Definition: retypes.h:1

◆ 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  }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS TCPSendData(PCONNECTION_ENDPOINT Connection, PCHAR Buffer, ULONG DataSize, PULONG DataUsed, ULONG Flags, PTCP_COMPLETION_ROUTINE Complete, PVOID Context)
Definition: tcp.c:525
PCONNECTION_ENDPOINT Connection
Definition: iptest.cpp:244
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
GLenum GLsizei len
Definition: glext.h:6722
Status
Definition: gdiplustypes.h:24
unsigned int * PULONG
Definition: retypes.h:1

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: