コード例 #1
0
 void Init()
 {
     protocol = new LVProtocol();
     listener = new USocketListener(OnOpen, OnClose, OnMessage);
     socket   = new USocket(listener, protocol);
     sender   = new USocketSender(socket);
     netState = NetState.Inited;
 }
コード例 #2
0
 public void Close()
 {
     if (socket != null)
     {
         socket.Close();
     }
     socket   = null;
     sender   = null;
     netState = NetState.Closed;
 }
コード例 #3
0
 public void Reset()
 {
     if (socket != null)
     {
         socket.Close();
     }
     socket   = new USocket(listener, protocol);
     sender   = new USocketSender(socket);
     netState = NetState.Inited;
 }