[Twisted-Python] Is it possible to write a tcp app which behaves like both client and server?

Itamar Shtull-Trauring itamar at itamarst.org
Tue Jun 28 10:56:25 EDT 2005

On Tue, 2005-06-28 at 20:36 +0800, Eric Hsu wrote:

> Or: Could I write a server which can connect (from the port it's
> listening on) to another known server?

You can't have (in TCP) something that is both server and client on same
port. You can either connect while bound to a port or you can listen to
a port. It is possible with UDP, however.

However: there is no reason why TCP clients should connect *from* a
specific port, it doesn't give you anything. So why bother? Just have
servers listen on a well known port.

More information about the Twisted-Python mailing list