void Init() { protocol = new LVProtocol(); listener = new USocketListener(OnOpen, OnClose, OnMessage); socket = new USocket(listener, protocol); sender = new USocketSender(socket); netState = NetState.Inited; }
public void Close() { if (socket != null) { socket.Close(); } socket = null; sender = null; netState = NetState.Closed; }
public void Reset() { if (socket != null) { socket.Close(); } socket = new USocket(listener, protocol); sender = new USocketSender(socket); netState = NetState.Inited; }