//public public cTcpSocketClientThread(cTcpSocketClient tssSocketClient) { // // Remember our parent object // SocketClient = tssSocketClient; encoding = Encoding.GetEncoding("Windows-1252"); }
public cTcpSocket(int iConnectionType, string sServerAddress, int iReconnectInterval, bool bConnectAutomatically, int iPortNumber, int iPacketTimeout, int iWrapMethod) { ConnectionMethod = iConnectionType; WrapMethod = iWrapMethod; PacketTimeout = iPacketTimeout; switch (ConnectionMethod) { case ConnectionMethod_SocketServer: TcpSocketServer = new cTcpSocketServer(this, iPortNumber); break; case ConnectionMethod_SocketClient: TcpSocketClient = new cTcpSocketClient(this, sServerAddress, iReconnectInterval, bConnectAutomatically); break; default: break; } }