private void ServerSocket_Connect(NetworkThread.BufferedSocket sck) { if (sck.sck != null) { /* SUCCESS!!! */ this.ServerSocket = sck; this._connected = true; this.IRCSend("NICK " + this.MyNickname); this.IRCSend("USER " + this.MyUsername + " * * :" + this.MyRealname); this.IRCSend("PROTOCTL NAMESX"); } else { /* FAILED :( */ this.ServerPage.MessageInfo("Waah, couldn't connect: " + sck.sckError.ToString()); return; } }
public static void DoConnect(string address, int port, NetworkThread.ConnectCallback cb) { foreach (NetworkThread nt in mNetThreads) { if (nt.AvailableSlot() >= 1) { nt.AddSocket(address, port, cb); return; } } mNetThreads.Add(new NetworkThread(address, port, cb)); }