Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to ask about the easiest way to develop a tcp-server on ubuntu :)

share|improve this question

closed as not a real question by Eliah Kagan, jokerdino, Alvar, Mitch, Thomas Ward Jul 11 '12 at 15:49

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

That's a VERY broad question. – hometoast Jul 10 '12 at 17:18
Not to mention ambiguous, such as use case, etc. – Thomas Ward Jul 10 '12 at 17:32
I would recommend you to specify what you want, what you know, and go from there. But still it's a huge question. Have you tried to Google on the subject? – Alvar Jul 11 '12 at 15:41

A quick way to get a TCP server up & running is to use the tcpserver program:


   tcpserver - accept incoming TCP connections


tcpserver  [ -146jpPhHrRoOdDqQv ] [ -climit ] [ -xrules.cdb ] 
           [ -Bbanner ] [ -ggid ] [ -uuid ] [ -bbacklog ] [ -llocalname ] 
           [ -ttimeout ] [ -Iinterface ] host port program [ arg ...  ]


tcpserver waits for connections from TCP clients. For each connection, it runs program with the given arguments, with descriptor 0 reading from the network and descriptor 1 writing to the network.

The server's address is given by host and port. host can be 0, allowing connections from any host; or a particular IP address, allowing connections only to that address; or a host name, allowing connections to the first IP address for that host. port may be a numeric port number or a port name. If port is 0, tcpserver will choose a free port.

. . .

You could also use socat.

share|improve this answer
This is a good answer...but not to this question. While it's somewhat unclear what the OP wants here (more info will have to be provided for this question to be reopened), the OP is interesting in writing a TCP server (of some kind), not in what TCP relays/superservers are available out-of-the-box. – Eliah Kagan Jul 11 '12 at 15:51

I would (and did) try Python with the Twisted Framework.

share|improve this answer
Twisted is quite powerful, but I wouldn't call it easiest. Especially comparing to Python's built in SocketServer… – vartec Jul 11 '12 at 15:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.