I am in need of a C# layer which will help to exchange the data between two TCP ports which are listening.
For example, There is a listener port @ 192.168.1.2::5555 and another listener port @ 192.168.1.4::6666.
I am able to establish the connection to both the listeners using socket.connect
I am getting confused during creation of 2 threads
1> Sock1.read()->convert to bytes ->sock2 .write()
2> Sock2.read()->Convert to bytes -> Sock1.write()
I think this is entering into the infinite loop. Is there any better way of exchanging packets between 2 Listening ports by establishing connection to both ports?
I have to implement a method
Private void ExchangePackets(IpEndpoint ipe1,IpEndpoint ipe2)
{
//code here
}
$Finally Achieved it 🙂 $