Exemplo n.º 1
0
 void TcpServer_evOpenConnection(object sender, SocketServer.OpenConnectionEventArgs e) {
   if (OnOpenConnection != null)
     OnOpenConnection(this, new SmppConnectionEventArgs(e.ConnGuid));
 }
Exemplo n.º 2
0
 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);
   }
 }
Exemplo n.º 3
0
 public SmppServer(SmppServerSettings Settings) {
   TcpServer = new SocketServer();
   _Settings = Settings;
   ConfigureServer();
 }
Exemplo n.º 4
0
 void TcpServer_evClassInformation(object sender, SocketServer.ClassInformationEventArgs e) {
   log.Info("Devshock: " + e.Description);
 }