C#SMPP客户端要使用的内容



我已经注册了jamaa smppclient

        SmppClient client = new SmppClient();
        SmppConnectionProperties properties = client.Properties;
        properties.SystemID = "uname";
        properties.Password = "pass";
        properties.Port = 2775; //IP port to use
        properties.Host = "ip"; //SMSC host name or IP Address
        properties.SystemType = "mysystemtype";
        properties.DefaultServiceType = "mydefaultservicetype";
        //Resume a lost connection after 30 seconds
        client.AutoReconnectDelay = 3000;
        //Send Enquire Link PDU every 15 seconds
        client.KeepAliveInterval = 15000;
        //Start smpp client
        client.Start();
        //client.ConnectionStateChanged += client_ConnectionStateChanged;
        TextMessage msg = new TextMessage();
        msg.DestinationAddress = "number"; //Receipient number
        msg.SourceAddress = "number"; //Originating number
        msg.Text = "Hello, this is my test message!";
        msg.RegisterDeliveryNotification = true; //I want delivery notification for this message
        //SmppClient client = GetSmppClient();
        client.SendMessage(msg);

但是我得到了

在jamaatech.smpp.net.client.v1.4.dll

Jamaa是分叉的吗?

[JAMAA-SMPP]

您需要在创建SmppClient实例之后以及启动Client时添加一些延迟。

SmppClient client = new SmppClient();
System.Threading.Thread.Sleep(3000);

client.Start();
System.Threading.Thread.Sleep(3000);

原因是通过异步方法完成连接的原因,而您的命令发送消息命令过早。

最新更新