📄 type_gsocketserverbase.html
字号:
<html><head><title>Generated Documentation</title></head><body> <image src="headerimage.png"> <br><br><table><tr><td><big><big><big style="font-family: arial;"><b>GSocketServerBase</b></big></big></big><br><br></td><td></td></tr></table><br><br><big><big><i>Constructors (public)</i></big></big><br><div style="margin-left: 40px;"><big><b>GSocketServerBase</b></big>(bool bUDP, int nPort, int nMaxConnections)<br></div><br><big><big><i>Destructors</i></big></big><br><div style="margin-left: 40px;"><big><b>~GSocketServerBase</b></big>()<br></div><br><big><big><i>Abstracts</i></big></big><br><div style="margin-left: 40px;">bool <big><b>Receive</b></big>(unsigned char* pBuf, int nLen, int nConnectionNumber)<br><div style="margin-left: 80px;"><font color=brown> This method is abstract because you need to implement something here</font></div><br></div><br><big><big><i>Virtual (non-public)</i></big></big><br><div style="margin-left: 40px;">void <big><b>OnAcceptConnection</b></big>(int nConnection)<br><div style="margin-left: 80px;"><font color=brown> This method is empty. It's just here so you can override it. WARNING: the connection isn't fully open at the time this method is called, so don't send anything back to the client inside this callback</font></div><br>void <big><b>OnCloseConnection</b></big>(int nConnection)<br><div style="margin-left: 80px;"><font color=brown> This method is empty. It's just here so you can override it. This is called when the connection is gracefully closed. (There is no built-in support for detecting ungraceful disconnects. This is a feature, not a bug, because it makes it robust to sporadic hardware. To detect ungraceful disconnects, I recommend requiring the client to send periodic heartbeat packets and calling Disconnect() if they stop coming.)</font></div><br></div><br><big><big><i>Public</i></big></big><br><div style="margin-left: 40px;">void <big><b>Disconnect</b></big>(int nConnectionNumber)<br>in_addr* <big><b>GetMyIPAddr</b></big>()<br>int <big><b>GetSocketHandle</b></big>(int nConnectionNumber)<br><div style="margin-left: 80px;"><font color=brown> This returns the SOCKET</font></div><br>in_addr* <big><b>GetTheirIPAddr</b></big>(int nConnectionNumber)<br>char* <big><b>GetTheirIPAddr</b></big>(char* szBuff, int nBuffSize, int nConnectionNumber)<br>char* <big><b>GetTheirName</b></big>(char* szBuff, int nBuffSize, int nConnectionNumber)<br>bool <big><b>IsConnected</b></big>(int nConnectionNumber)<br>bool <big><b>Send</b></big>(const unsigned char* pBuf, int nLen, int nConnectionNumber)<br>void <big><b>ServerWorker</b></big>()<br></div><br><big><big><i>Protected</i></big></big><br><div style="margin-left: 40px;">int <big><b>GetFirstAvailableConnectionNumber</b></big>()<br>void <big><b>HandleNewConnection</b></big>()<br>void <big><b>Init</b></big>(bool bUDP, int nPort, int nMaxConnections)<br><div style="margin-left: 80px;"><font color=brown> Don't call this method directly</font></div><br>void <big><b>JoinWorkerThread</b></big>()<br>void <big><b>ReduceConnectionList</b></big>()<br>int <big><b>RefreshSocketSet</b></big>()<br></div><br></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -