コード例 #1
0
ファイル: TCP - server.cs プロジェクト: Zezis/ProjectZezi
        public client(TcpClient client,TCPServer root,int id)
        {
            this.iD = id;
            this.root = root;
            this.Client = client;
            if(client.Connected)this.remoteEndPoint = Client.Client.RemoteEndPoint;

            if (root.ConsoleStatus) Text.WriteLine("Initializing stream and threads...  ID: "+ID,ConsoleColor.Black,ConsoleColor.Yellow);

            try
            {
                //get stream
                stream = Client.GetStream();
                //start receive
                Threads.New(new Asynch(receive), null);
                if (root.ConsoleStatus) Text.WriteLine("Client initialized! ID: "+ID, ConsoleColor.Black, ConsoleColor.Green);
            }
            catch {if (root.ConsoleStatus) Text.WriteLine("Client initializing failed! Error initializing stream or threads! ID: "+ID, ConsoleColor.Black, ConsoleColor.Green);}
        }
コード例 #2
0
ファイル: BloodBaneServer.cs プロジェクト: Zezis/ProjectZezi
 public void Start()
 {
     server = new TCPServer(Port, (UInt32)dataLengh, 0, (UInt32)SleepReceive);
     server.Start();
 }