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