socket programming

Warren Postma embed at geocities.com
Tue May 16 08:54:59 EDT 2000


<tiddlerdeja at my-deja.com> wrote in message
news:8fr4vf$k96$1 at nnrp1.deja.com...
> A server application can bind to a socket and listen for connections
> (e.g. smtp:25). Is it possible, say for testing purposes,  for another
> program to bind to the same socket at the same time and monitor the
> data i/o ?


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".

Warren






More information about the Python-list mailing list