Entry
Is it possible for a program to bind to a socket when that socket is already bound to another application to monitor i/o?
May 17th, 2000 02:12
unknown unknown, Oleg Broytmann, Warren Postma
It is impossible.
But, why not write a Python program to be a server on port 25, which
just opens another port and relays the data. Then reconfigure your
original server (say SMTP) to go somewhere else, like 8881, and your
Python program can redirect (with a small delay) as well as dumping out
what comes in?
You can't leave your server app on the port and let anyone else use it,
but you can fake it with a relay+dumping program. You could also (on
Windows NT/2000 but not on Unix) "hook" the Winsock DLL functions. For
more on how to build DLL hooks, go to the Microsoft Research web page
and look for "DLL hooks".