Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

4  
That's a VERY broad question. –  hometoast Jul 10 '12 at 17:18
2  
Not to mention ambiguous, such as use case, etc. –  Thomas W. Jul 10 '12 at 17:32
1  
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

2 Answers 2

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

NAME

   tcpserver - accept incoming TCP connections

SYNOPSIS

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

DESCRIPTION

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 docs.python.org/library/… –  vartec Jul 11 '12 at 15:51

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