示例#1
0
        public SocketClient(SocketServer server, Socket client)
        {
            this.server = server;
            this.client = client;
            this.da = new DataAccess();
            this.user = new User();
            this.dataReceived = 0;

            userSerializer = new DataContractJsonSerializer(typeof(User));
            messageSerializer = new DataContractJsonSerializer(typeof(Message));
            stream = new MemoryStream();

            Thread thread = new Thread(StartReceivingData);
            thread.Start();
        }
示例#2
0
文件: Program.cs 项目: jags9415/chat
 static void InitSocket()
 {
     SocketServer server = new SocketServer(3030);
     server.Start();
 }