/// <summary> /// Connection to the service and checking for response /// </summary> /// <returns>true if suceeds, otherwise false</returns> public bool Connect() { myEndPoint = new EndpointAddress("net.tcp://" + iport[0] + ":" + iport[1] + "/CoProService"); wcfclient = new ServiceReference1.CoProServiceClient(context, mybinding, myEndPoint); try { ExpectedSequence = wcfclient.GetExpectedSeq() - 1; //insert function that gets the id return(wcfclient.IsConnected()); } catch (Exception e) { return(false); } }
/// <summary> /// Connection to the service and checking for response /// </summary> /// <returns>true if suceeds, otherwise false</returns> public bool Connect() { myEndPoint = new EndpointAddress("net.tcp://" + iport[0] + ":" + iport[1] + "/CoProService"); wcfclient = new ServiceReference1.CoProServiceClient(context, mybinding, myEndPoint); try { ExpectedSequence = wcfclient.GetExpectedSeq() - 1; //insert function that gets the id return wcfclient.IsConnected(); } catch (Exception e) { return false; } }