Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/08 18:39:38 (16 years ago)
Author:
abeham
Message:

[TICKET #297] fixed some bugs in the TCP connection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Communication.Operators/TcpNetworkInitiator.cs

    r591 r705  
    4646      socket.Initialize(config);
    4747      while (!socket.Connect()) ;
     48      try {
     49        socket.Write("REQUEST_CONNECT");
     50        if (!socket.Read().Equals("REQUEST_CONNECT")) throw new InvalidOperationException("ERROR in TcpNetworkInitiator: Remote host answered with unknown response!");
     51        socket.Write("ACK");
     52        if (!socket.Read().Equals("ACK")) throw new InvalidOperationException("ERROR in TcpNetworkInitiator: Remote host answered with unknown response!");
     53      } catch (Exception) {
     54        try {
     55          socket.Close();
     56        } catch (Exception) { }
     57        return new AtomicOperation(this, scope);
     58      }
    4859
    4960      IVariableInfo info = GetVariableInfo("NetworkConnection");
Note: See TracChangeset for help on using the changeset viewer.