public bool RunFrameData(NetChannelType channel, int frameIndex) { NetChannel netChannel = GetChannel(channel); if (netChannel == null) { return(false); } return(netChannel.RunFrameData(frameIndex)); }
public bool BeginConnect(NetChannelType channel, string ip, int port, Action <bool, NetChannelType> callback = null) { NetChannel netChannel = GetChannel(channel); if (netChannel == null) { return(false); } return(netChannel.BeginConnect(ip, port, callback)); }
public void DisConnect(NetChannelType channel) { NetChannel netChannel = GetChannel(channel); if (netChannel == null) { return; } netChannel.DisConnect(); }
public void RemoveMsgCallback(NetChannelType channel, short receiveOpcode, MsgCallback callback) { if (callback != null) { NetChannel netChannel = GetChannel(channel); if (netChannel == null) { return; } netChannel.RemoveMsgCallback(receiveOpcode, callback); } }
public void AddMsgCallback(NetChannelType channel, short receiveOpcode, MsgCallback callback, bool once = false) { if (callback != null) { NetChannel netChannel = GetChannel(channel); if (netChannel == null) { return; } netChannel.AddMsgCallback(receiveOpcode, callback, once); } }
//不监听回复消息 public void SendMsg(NetChannelType channel, short sendOpcode, object data) { NetSendData sendData; sendData.sendOpcode = sendOpcode; sendData.data = data; NetChannel netChannel = GetChannel(channel); if (netChannel == null) { return; } netChannel.SendMsg(sendData); }
public void CreateChannel(NetChannelType channel, NetChannelModeType channelMode) { var curChannel = GetChannel(channel); if (curChannel != null) { curChannel.DisConnect(); } curChannel = null; switch (channelMode) { case NetChannelModeType.Tcp: curChannel = new NetChannel(channel, new TCPSocketClient()); break; case NetChannelModeType.StandAlone: curChannel = new NetChannel(channel, new StandAloneSocketClient()); break; } m_arrChannel[(int)channel] = curChannel; }