void TcpServer_evOpenConnection(object sender, SocketServer.OpenConnectionEventArgs e) { if (OnOpenConnection != null) OnOpenConnection(this, new SmppConnectionEventArgs(e.ConnGuid)); }
void TcpServer_evDataReceived(object sender, SocketServer.DataReceivedEventArgs e) { while (e.Session.dataIn.Count >= 4) { int count = SmppConverter.FromByteArrayToInt32(e.Session.PeekBytes(4)); if (count > _Settings.MaxPduLength) { TcpServer.Disconnect(e.Session.ConnGuid); return; } if (count > e.Session.dataIn.Count) break; ProcessPdu(e.Session.ConnGuid, new ByteBuilder(e.Session.dataIn.ToArray(0, count))); e.Session.dataIn.RemoveRange(0, count); } }
public SmppServer(SmppServerSettings Settings) { TcpServer = new SocketServer(); _Settings = Settings; ConfigureServer(); }
void TcpServer_evClassInformation(object sender, SocketServer.ClassInformationEventArgs e) { log.Info("Devshock: " + e.Description); }