Questions tagged [tcp]
87 questions
26
votes
2 answers
TCP or UDP for a multiplayer game?
This is a question I see a lot. Most people say UDP is always better for real-time games than TCP. My understanding is that TCP tries to re-send packets over and over til the other side gets them whereas UDP doesn't care.
Most of the things I've…

flooblebit
- 503
- 1
- 4
- 6
25
votes
1 answer
Async network programming using Reactive Extensions
After doing some (more-or-less) "low-level" async socket programming years ago (in an Event-based Asynchronous Pattern (EAP) fashion) and recently moving "up" to a TcpListener (Asynchronous Programming Model (APM)) and then trying to move to…

RobIII
- 341
- 3
- 9
15
votes
12 answers
Understanding the stateless internet
I'm transitioning from being a desktop developer to a web developer, and I'm having trouble understanding why HTTP is stateless. What are the reasons for it? What are some ways a desktop developer like myself can make the transition to a stateless…

P.Brian.Mackey
- 11,123
- 8
- 48
- 87
15
votes
3 answers
Is it a good idea to multiplex blocking streams into a TCP connection?
I need several duplex channels between two hosts. There are a number of advantages to establish only one TCP connection. But I doubt multiplexing would cause some inevitable problems. Will it harm performance or increase latency significantly? And…

Sherwood Wang
- 373
- 3
- 10
14
votes
2 answers
Comparing TCP/IP applications vs HTTP applications
I'm interested in developing a large-scale user-facing website that is written in Java.
As for design, I'm thinking of developing independent, modular services that can act as data providers to my main web application.
As for writing these modular…

HiChews123
- 1,103
- 2
- 9
- 10
9
votes
4 answers
Is there any way to establish a direct connection between 2 mobile devices over internet?
In the company I’m working we have our own iOS\Android\WP apps which allow our employees to share a certain type of files to each other. This app works through our server but recently we encountered a situation when some of our employees need to…

user3223738
- 459
- 1
- 4
- 6
8
votes
2 answers
TCP - Three Way Handshake, which Port?
I am trying to understand the Three way handshake in the TCP connection setup.
My book states, the client first contacts the server, say we want an HTTP connection, so it sends a SYN to port 80. (1)
The server then replies a SYN ACK package. (Here…

spooky
- 81
- 1
- 2
8
votes
3 answers
TCP and UDP basics: connecting to a website
I am just learning computer networks so please forgive me if this question is naive. I know the TCP protocol binds itself to a port till the transfer of messages is over (port 80) and UDP is best effort (ie no binding). My question is if I try and…

Rahul Kumar
- 181
- 1
- 1
- 2
7
votes
4 answers
Is it true that for Observer Pattern to work, there probably is some polling mechanism underneath?
The short question is: is it true that for Observer Pattern to work, there probably is some polling mechanism underneath? (update: in a network situation)
It was quite amazing that if on my Macbook Pro, I save a file Hello World.txt into the Dropbox…

nonopolarity
- 1,827
- 1
- 16
- 30
7
votes
5 answers
Does data size in TCP/UDP make a difference on transmission time
While discussing the development of a network component for our game engine, a member of our team suggested that transmitting either 500 bytes or 1k of data using UDP makes no difference from performance perspective of the system (the time it takes…

liortal
- 1,165
- 3
- 11
- 11
5
votes
1 answer
Low latency TCP sockets in .NET
Is it possible to optimize a .NET application running on a server version of Windows for near-zero latency TCP communication? Or will there always be unpredictable/unavoidable delays?
For example, while searching for low-latency open source apps I…

user7834712
- 53
- 3
5
votes
3 answers
Local client-server communication through files or TCP?
I have a Python client launching a subprocess in C++.
The C++ program runs several threads that need to report results to the Python client.
Knowing that both the Python client and the C++ subprocess are running on the same machine, what is the…

Chuque
- 179
- 2
- 6
5
votes
2 answers
How to handle thousands of messages to C socket?
I currently have a setup looking like this:
__________________ _________ ________ ___________
| Front end server |----| Varnish |----| NodeJS |----| C-service |
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ ‾‾‾‾‾‾‾‾‾ ‾‾‾‾‾‾‾‾ …

Woodgnome
- 151
- 4
5
votes
2 answers
How can I write a flexible messaging structure for sending TCP messages to clients and server
The general question: how can I write a flexible, but not property heavy, messaging structure for sending TCP messages to clients and server?
Example:
I have a TCP Server for a game that sends some messages through TCP sockets to clients:
Chat…

tones31
- 787
- 1
- 5
- 13
4
votes
2 answers
Has CRC check on top of TCP any meaning?
For our project, a protocol is specified for communication between an embedded linux device and a PLC/HMI. This protocol includes CRC checking.
However, the communication is now done over TCP (TCP protocol includes CRC), so my question is whether or…

drC1Ron
- 153
- 1
- 5