Files
SLikeNet/Help/RakNet/documentation/tcpinterface.html
2025-11-24 14:19:51 +05:30

62 lines
3.4 KiB
HTML

<HTML>
<HEAD>
<TITLE>TCPInterface manual</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</HEAD>
<link href="RaknetManual.css" rel="stylesheet" type="text/css">
<meta name="title" content="RakNet - Advanced multiplayer game networking API">
</HEAD><BODY BGCOLOR="#ffffff" LINK="#003399" vlink="#003399" alink="#003399" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"">
<span style="background-color: rgb(255, 255, 255);"><img src="RakNet_Icon_Final-copy.jpg" alt="Oculus VR, Inc." width="150" height="150"></span><BR>
<BR>
<table width="100%" border="0">
<tr>
<td bgcolor="#2c5d92" class="RakNetWhiteHeader">&nbsp;TCP Interface Overview</td>
</tr>
</table>
<TABLE BORDER="0" CELLPADDING="10" CELLSPACING="0" WIDTH="100%">
<TR>
<TD><p><span class="RakNetBlueHeader">Connect to Telnet, HTTP servers, mail servers, or other</span> <BR>
<BR>
TCPInterface, found at TCPInterface.h, is a utility class designed to connect using the TCP protocol in cases where this is necessary. The connection process is similar to RakPeerInterface.h, with the exception that Receive() returns the actual data received, the first byte does not contain any specific identifiers.</p>
<p>To get connection status updates, use HasNewConnection() and HasLostConnection()</p>
<p>There is no sample that uses the TCPInterface class specifically, but TelnetTransport.cpp is a good place to look for a reference.</p>
<p><strong>Functions:</strong></p>
<p>// Starts the TCP server on the indicated port<br>
<span class="RakNetCode">bool Start(unsigned short port, unsigned short maxIncomingConnections);</span></p>
<p> // Stops the TCP server<br>
<span class="RakNetCode">void Stop(void);</span></p>
<p> // Connect to the specified host on the specified port<br>
<span class="RakNetCode">SystemAddress Connect(const char* host, unsigned short remotePort);</span></p>
<p> // Sends a byte stream<br>
<span class="RakNetCode">void Send( const char *data, unsigned length, SystemAddress systemAddress );</span></p>
<p> // Returns data received<br>
<span class="RakNetCode">Packet* Receive( void );</span></p>
<p> // Disconnects a player/address<br>
<span class="RakNetCode">void CloseConnection( SystemAddress systemAddress );</span></p>
<p> // Deallocates a packet returned by Receive<br>
<span class="RakNetCode">void DeallocatePacket( Packet *packet );</span></p>
<p> // Queued events of new connections<br>
<span class="RakNetCode">SystemAddress HasNewConnection(void);</span></p>
<p> // Queued events of lost connections<br>
<span class="RakNetCode">SystemAddress HasLostConnection(void);</span></p>
</TR>
</TABLE>
<table width="100%" border="0">
<tr>
<td bgcolor="#2c5d92" class="RakNetWhiteHeader"><img src="spacer.gif" width="8" height="1">See Also</td>
</tr>
</table>
<TABLE BORDER="0" CELLPADDING="10" CELLSPACING="0" WIDTH="100%">
<TR>
<TD> <p><A HREF="index.html">Index</A><br>
<a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol">TCP (Wikipedia)</a><br>
<a href="emailsender.html">Email Sender</a><BR>
</p>
</TD>
</TR>
</TABLE></TD>
</TR></TABLE>
</BODY>
</HTML>