예제 #1
0
 private void CleanUp()
 {
     if (server != null)
         server.StopServer();
     if (user != null)
         user.Disconnect();
     server = null;
     user = null;
 }
예제 #2
0
파일: Server.cs 프로젝트: fnasim/VTC
 public Client(Socket c, Server s)
 {
     connectionID++;
         this.sock = c;
         this.server = s;
         stream = new NetworkStream(sock);
         callbackRead = new AsyncCallback(this.OnReadComplete);
         callbackWrite = new AsyncCallback(this.OnWriteComplete);
         buffer = new byte[256];
         writebuffer = new byte[256];
         user = new User();
         channel = new Channel();
 }
예제 #3
0
        private void StartServer()
        {
            LoggerCallback logger = new LoggerCallback (this.UpdateLogThreaded);
            try
            {
                server = new Server(int.Parse(txtServerPort.Text));
                user = new UserBase();
                //server.BindSigninNotify(new GenericCallback(this.UpdateSignin));
                //server.BindSignoutNotify(new GenericCallback(this.UpdateSignout));

                server.BindUserBase(user);
                server.BindDebugObject(logger);
                user.BindDebugObject(logger);

                server.StartServer();
                user.Connect();
            }
            catch (Exception ex)
            {
                UpdateLog("Port address is incorrect or already in use. " + ex.Message);
            }
        }
예제 #4
0
파일: Channel.cs 프로젝트: fnasim/VTC
 public Channel(long id, Server.Client client)
 {
     ChannelID = id;
     ChannelClient = client;
     ChannelOwner = ChannelClient.user;
 }