Transmission Control Protocol (TCP) is a transport layer protocol that provides a connection-oriented data stream service with guaranteed, in-order delivery.
129
votes
18answers
158k views
How can I connect to Android with ADB over TCP?
I am attempting to debug an application on a Motorola Droid but I am having some difficulty connecting to the device via USB. My development server is a Windows 7 64bit VM running in HyperV and so I ...
80
votes
8answers
19k views
Why is SCTP not much used/known
I recently checked out the book "UNIX Network Programming, Vol. 1" by Richards Stevens and I found that there is a third transport layer standard besides TCP and UDP: SCTP.
Summary: SCTP is a ...
70
votes
16answers
18k views
How to write a scalable Tcp/Ip based server
I am in the design phase of writing a new Windows Service application that accepts TCP/IP connections for long running connections (i.e. this is not like HTTP where there are many short connections, ...
69
votes
20answers
31k views
When is it appropriate to use UDP instead of TCP?
Since TCP guarantees packet delivery and thus can be considered "reliable", whereas UDP doesn't guarantee anything and packets can be lost, what would the advantage be of transmitting data using UDP ...
69
votes
7answers
34k views
Simulate delayed and dropped packets on Linux
I would like to simulate packet delay and loss for UDP and TCP on Linux to measure the performance of an application. Is there a simple way to do this?
58
votes
14answers
67k views
In C#, how to check if a TCP port is available?
In C# to use a TcpClient or generally to connect to a socket how can I first check if a certain port is free on my machine?
more info:
This is the code I use:
TcpClient c;
//I want to check here if ...
53
votes
10answers
49k views
UDP vs TCP, how much faster is it?
For general protocol message exchange, with loss tolerant. How much more efficient is UDP over TCP?
52
votes
12answers
11k views
Why is it impossible, without attempting I/O, to detect that TCP socket was gracefully closed by peer?
As a follow up to a recent question, I wonder why it is impossible in Java, without attempting reading/writing on a TCP socket, to detect that the socket has been gracefully closed by the peer? This ...
45
votes
3answers
41k views
What does “connection reset by peer” mean?
What is the meaning of the "connection reset by peer" error on a TCP connection? Is it a fatal error or just a notification?
42
votes
8answers
41k views
Can two applications listen to the same port?
As simple as it gets - can two applications on the same machine bind to the same port and ip address? Taking it a step further, can one app listen to requests coming from a certain ip and the other to ...
39
votes
1answer
15k views
Who is listening on a given TCP port on Mac OS X?
On Linux, I can use netstat -pntl | grep $PORT or fuser -n tcp $PORT to find out which process (PID) is listening on the specified TCP port. How do I get the same information on Mac OS X?
38
votes
11answers
19k views
What do you use when you need reliable UDP?
If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out ...
35
votes
13answers
9k views
Artificially create a connection timeout error
I've had a bug in our software that occurs when I receive a connection timeout. These errors are very rare (usually when my connection gets dropped by our internal network). How can I generate this ...
35
votes
4answers
23k views
How do multiple clients connect simultaneously to one port, say 80, on a server?
I understand the basics of how ports work. However, what I don't get is how multiple clients can simultaneously connect to say port 80. I know each client has a unique (for their machine) port. Does ...
35
votes
2answers
18k views
What is the theoretical maximum number of open TCP connections that a modern Linux box can have
Assuming infinite performance from hardware, can a Linux box support >65536 open TCP connections?
I understand that the number of ephemeral ports (<65536) limits the number of connections from one ...