Commit a9dd36c5 by Yannick Körber

csharp: bug fix: tcpsockethandler sends now correctly heartbeats. java&csharp:…

csharp: bug fix: tcpsockethandler sends now correctly heartbeats. java&csharp: bugfix: discoverer.deinit in discovererClient
parent e1b99740
......@@ -63,6 +63,7 @@ namespace de.dfki.tecs.direct
}
if (heartbeatIH.ShouldExecute()) {
// Console.WriteLine("sending heartbeat");
SendHeartbeat ();
try{
UpdateSend();
......@@ -184,7 +185,7 @@ namespace de.dfki.tecs.direct
for(int i=0; i<HEADER_SIZE; i++){
hearbeat[i] = 0;
}
OutgoingData.Enqueue(new MemoryStream(hearbeat, 0, 0, true, true));
OutgoingData.Enqueue(new MemoryStream(hearbeat, 0, HEADER_SIZE, true, true));
}
......
......@@ -61,7 +61,7 @@ namespace de.dfki.tecs.direct.dis{
if(ConfirmService(_service)){
try{
connection = Connect(_service);
discoverer.Shutdown();
discoverer.Deinitialize();
state = State.COMMUNICATION;
InitCommunication(connection);
}catch(Exception e){
......@@ -83,7 +83,14 @@ namespace de.dfki.tecs.direct.dis{
state = State.INIT_DISCOVERY;
return;
}
UpdateCommunication(connection);
try{
UpdateCommunication(connection);
}catch(Exception ex){
if(IsConnected(connection)){
Disconnect(connection);
}
state = State.INIT_DISCOVERY;
}
}
protected abstract T Connect(Service service);
......
......@@ -55,7 +55,7 @@ public abstract class DiscovererClient<T> extends IUDThread {
if(confirmService(service)){
try {
connection = connect(service.getHost(), service.getPort());
discoverer.shutdown();
discoverer.deinitialize();
state = State.COMMUNICATION;
initCommunication(connection);
} catch (IOException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment