private NicoClient(NicoServerInfo serverInfo, NicoThread threadData) { var packetEnDecoder = new NicoPacketEnDecoder(); client.Encoder = packetEnDecoder; client.Decoder = packetEnDecoder; client.OnSocketException += (s, e) => Console.WriteLine(e.Exception.Message); client.OnDisconnect += (s, e) => Console.WriteLine("Disconnected."); client.OnConnected += (s, e) => { Console.WriteLine("Connected"); e.Send(threadData); }; client.OnDataReceived += client_OnDataReceived; client.Connect(new DnsEndPoint(serverInfo.Address, serverInfo.Port)); }
public static NicoClient Connect(NicoServerInfo info, NicoThread thread) { return(new NicoClient(info, thread)); }
public NicoThread(NicoServerInfo info) : this() { this.Thread = info.ThreadId; }