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