The problem is that i haven't got the Open status after i call Connect method.
Code: Select all
if (_smppClient.Status == ConnectionStatus.Closed)
_smppClient.Connect(_hostName, Convert.ToInt32(_port));
//while (true)
{
if (_smppClient.Status == ConnectionStatus.Open)
{
if (OnConnected != null)
OnConnected();
Bind();
//break;
}
else
if (OnError != null)
OnError("Connection failed");
}
What are the reasons of such a behaviour?
I tried to use the evConnect event, but it wasn't useful:
Code: Select all
private void smppClient_evConnect(object sender, bool success)
{
if (success)
{
if (_smppClient.Status == ConnectionStatus.Open)
{
if (OnConnected != null)
OnConnected();
Bind();
}
else
if (OnError != null)
OnError("Connection failed");
}
else
if (OnError != null)
OnError("Already connected");
}