📄 classptcpsocket.html
字号:
</table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>tcpSocket</em> </td><td>Listening socket making the connection. </td></tr></table></dl> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="z429_2" doxytag="PTCPSocket::Accept"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PTCPSocket::Accept </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classPSocket.html">PSocket</a> & </td> <td class="mdname1" valign="top" nowrap> <em>socket</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Open a socket to a remote host on the specified port number. This is an "accepting" socket. When a "listening" socket has a pending connection to make, this will accept a connection made by the "connecting" socket created to establish a link.<p>The port that the socket uses is the one used in the <a class="el" href="classPTCPSocket.html#z429_0">Listen()</a># command of the socket# parameter.<p>Note that this function will block until a remote system connects to the port number specified in the "listening" socket.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the channel was successfully opened. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>socket</em> </td><td>Listening socket making the connection. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPSocket.html#z369_3">PSocket</a>.<p>Reimplemented in <a class="el" href="classPSocksSocket.html#a5">PSocksSocket</a>, and <a class="el" href="classPTelnetSocket.html#a5">PTelnetSocket</a>. </td> </tr></table><a name="z425_0" doxytag="PTCPSocket::Clone"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual <a class="el" href="classPObject.html">PObject</a>* PTCPSocket::Clone </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Create a copy of the class on the heap. The exact semantics of the descendent class determine what is required to make a duplicate of the instance. Not all classes can even {\bf do} a clone operation.<p>The main user of the clone function is the PDictionary# class as it requires copies of the dictionary keys.<p>The default behaviour is for this function to assert.<p><dl compact><dt><b>Returns: </b></dt><dd> pointer to new copy of the class instance. </dl><p>Reimplemented from <a class="el" href="classPObject.html#z203_0">PObject</a>.<p>Reimplemented in <a class="el" href="classPSocks4Socket.html#a2">PSocks4Socket</a>, and <a class="el" href="classPSocks5Socket.html#a2">PSocks5Socket</a>. </td> </tr></table><a name="b2" doxytag="PTCPSocket::GetProtocolName"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual const char* PTCPSocket::GetProtocolName </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [protected, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>This function returns the protocol name for the socket type. <p>Implements <a class="el" href="classPSocket.html#b2">PSocket</a>. </td> </tr></table><a name="z429_1" doxytag="PTCPSocket::Listen"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PTCPSocket::Listen </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const Address & </td> <td class="mdname" nowrap> <em>bind</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>unsigned </td> <td class="mdname" nowrap> <em>queueSize</em> = 5, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>WORD </td> <td class="mdname" nowrap> <em>port</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classPSocket.html#z369_0">Reusability</a> </td> <td class="mdname" nowrap> <em>reuse</em> = AddressIsExclusive</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>queueSize</em> </td><td>Local interface address to bind to. </td></tr><tr><td valign=top><em>port</em> </td><td>Number of pending accepts that may be queued. </td></tr><tr><td valign=top><em>reuse</em> </td><td>Port number to use for the connection. Can/Can't listen more than once. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPIPSocket.html#a8">PIPSocket</a>. </td> </tr></table><a name="z429_0" doxytag="PTCPSocket::Listen"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual BOOL PTCPSocket::Listen </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned </td> <td class="mdname" nowrap> <em>queueSize</em> = 5, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>WORD </td> <td class="mdname" nowrap> <em>port</em> = 0, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap><a class="el" href="classPSocket.html#z369_0">Reusability</a> </td> <td class="mdname" nowrap> <em>reuse</em> = AddressIsExclusive</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Listen on a socket for a remote host on the specified port number. This may be used for server based applications. A "connecting" socket begins a connection by initiating a connection to this socket. An active socket of this type is then used to generate other "accepting" sockets which establish a two way communications channel with the "connecting" socket.<p>If the <a class="el" href="classPSocket.html#n0">port</a># parameter is zero then the port number as defined by the object instance construction or the PIPSocket::SetPort()# function.<p><dl compact><dt><b>Returns: </b></dt><dd> TRUE if the channel was successfully opened. </dl><dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>port</em> </td><td>Number of pending accepts that may be queued. </td></tr><tr><td valign=top><em>reuse</em> </td><td>Port number to use for the connection. Can/Can't listen more than once. </td></tr></table></dl><p>Reimplemented from <a class="el" href="classPIPSocket.html#a7">PIPSocket</a>.<p>Reimplemented in <a class="el" href="classPSocksSocket.html#a3">PSocksSocket</a>. </td> </tr></table><a name="z431_1" doxytag="PTCPSocket::OnOutOfBand"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> virtual void PTCPSocket::OnOutOfBand </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -