Esempio n. 1
0
        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));
        }
Esempio n. 2
0
 public static NicoClient Connect(NicoServerInfo info, NicoThread thread)
 {
     return(new NicoClient(info, thread));
 }
Esempio n. 3
0
 public NicoThread(NicoServerInfo info)
     : this()
 {
     this.Thread = info.ThreadId;
 }