|
@@ -180,9 +180,10 @@ namespace MECF.Framework.Common.Communications
|
|
|
{
|
|
|
lock (_locker)
|
|
|
{
|
|
|
+ if(_socket.Connected)
|
|
|
// Convert the string data to byte data using ASCII encoding.
|
|
|
//byte[] byteData = Encoding.ASCII.GetBytes(data);
|
|
|
- _socket.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), _socket);
|
|
|
+ _socket.BeginSend(byteData, 0, byteData.Length, 0, new AsyncCallback(SendCallback), _socket);
|
|
|
|
|
|
//LOG.Info(string.Format("Communication {0}:{1:D} Send {2}.", _ip, _port, data.TrimEnd('\n').TrimEnd('\r')));
|
|
|
}
|