Let's say our PC with IP 10.0.0.1 (local IP: 192.168.0.1) has an established connection on port 1001 to a server with IP 11.0.0.1 on port 1011. We can see this connection when we use the Netstat command:
TCP 192.168.0.1:1001 11.0.0.1:1011 ESTABLISHED
This connection was made by another program. Is it possible to programmatically access this existing socket and send data through it? It doesn't matter what language I have to use (preferably Java or .NET though).
Desired example:
Socket s = Socket.getEstablishedLocalConnection("11.0.0.1", 1001, 1011);
s.sendUrgentData(0);