Problem with connecting windows service through sockets
-
Hi All, The problem that we are facing is that we are unable to connect the windows service through the socket running on computer A from the windows application running on computer B. The following are the steps that we have followed. At Window Service Side running on Computer A:- · We have created a window service and under OnStart event we have initialize the object of TCP listener through port 8001. · Start the TCP listener. · Made a thread for WaitingForClient and start this thread so that it always lies in listen mode for accept the socket from Computer B. · In the method WaitingForClient we have accepted the socket and start another thread for read this socket. At Window Application running on Computer B:- Made a socket that has AddressFamily InterNetwork, SocketType is stream and ProtocolType is TCP. Made the object of IPEndPoint by initialize it through IP address of Computer A and Port 8001. When we connecting this socket to the Computer A through IPEndPoint, it does not connect and throws the exception of connection timeout. Plese Help............ Thanks and Regards, Lalit Narayan
-
Hi All, The problem that we are facing is that we are unable to connect the windows service through the socket running on computer A from the windows application running on computer B. The following are the steps that we have followed. At Window Service Side running on Computer A:- · We have created a window service and under OnStart event we have initialize the object of TCP listener through port 8001. · Start the TCP listener. · Made a thread for WaitingForClient and start this thread so that it always lies in listen mode for accept the socket from Computer B. · In the method WaitingForClient we have accepted the socket and start another thread for read this socket. At Window Application running on Computer B:- Made a socket that has AddressFamily InterNetwork, SocketType is stream and ProtocolType is TCP. Made the object of IPEndPoint by initialize it through IP address of Computer A and Port 8001. When we connecting this socket to the Computer A through IPEndPoint, it does not connect and throws the exception of connection timeout. Plese Help............ Thanks and Regards, Lalit Narayan
Does it work if you run the client and service on the same machine? If so, it's probably a firewall blocking your port. Nick
---------------------------------- Be excellent to each other :)
-
Does it work if you run the client and service on the same machine? If so, it's probably a firewall blocking your port. Nick
---------------------------------- Be excellent to each other :)