Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed yesterday.
Improve this question
I were making event based project, but when I tried to choose between TCP and UDP I got lost.
Connecting using TCP sounds good, but performance might be affected due to buffering.
On the other hand, UDP is more suitable in terms of performance and context, but some requests require guarantees and/or connection.
So, TCP or UDP?
Data Size < 2KB
Tested with TCP - a bit laggy on activity spikes with macroses, UDP is not implemented yet, but I usually have spikes of packet loss when working with it.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I need to intercept the communication between a client computer and the server computer, this communication is done via TCP sockets and i have to store that data in a server.
A TCP proxy can be a right solution or what should i do?
Thanks and sorry for my poor English
A tcp proxy can do the job. Also you could use wireshark on the client or server computer to capture the traffic.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Java Applets support socket but limits the connection towards the
http server from which the applet has been downloaded.
Why a WebSocket abstraction has been created for sending data
from Javascript/HTML 5 ? Wouldn't have been possible to add support
for a “classical” socket in JS and limit the connection (as it
has been done for Java Applets)
Because WebSocket starts as a HTTP request, therefore it is easier to go through firewalls and other inspectors. Also, such HTTP negotiation can do HTTP operations like sending/retrieving cookies from the browser for example, which provides a nice integration with the rest of the web application.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am wondering whether the transmission time of a TCP socket configurable. I am sending a TCP packet with payload of size 19 bytes and the transmission time seems to be 1 sec approx. Can this be brought down or does one have to just accept whatever it is?
How exactly do you calculate this time? I hope you're not comparing the time of two different computers, since their clocks are probably not identical.
However, having said this, you're probably suffering from the Nagle algorithm where the connection waits to transmit data to see if there's more to batch together. You can turn this off by setting the Tcp options.
http://msdn.microsoft.com/en-us/library/system.net.sockets.socket.nodelay.aspx
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
In the Wikipedia article, TCP communication is explained using the terms 'client' and 'server'. It also uses the word 'peers'.
But to my knowledge, the TCP standard does not define "TCP clients" and "TCP servers".
In the RFC 675 document (the "Specification of Internet Transmission Protocol Program"), the word "client" never appears. The RFC explains that TCP is used to connect processes over ports (sockets), and that 'A pair of sockets form a CONNECTION which can be used to carry data in either direction [i.e. full duplex].
However, calling the originating party the "client" seems to be common practice. But IMHO this client/server communication model is not always applicable to TCP communication. For example take peer-to-peer networks. Calling all processes which open a socket and wait for incoming connections from peers "TCP servers", sounds wrong to me. (And I would not call my uncle's telephone device a "Telephony server" if I dial his phone number and he picks up.)
TCP is only about connecting one process to another via a bi-directional, ordered byte stream. Talk of 'clients' and 'servers' describes a common usage pattern, but is external to the definition of TCP itself.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am looking to write a simple client/server utilizing TCP sockets. Any ideas how to do network programming in Go?
Go has fine support for networking.
For a server, the easiest thing to do is have your main() start a tcp accept loop and spawn a goroutine to handle each request.
The first go software I wrote was a memcached server. You may want to check out gomemcached for an idea of how to get started on servers.
Clients shouldn't be particularly harder. In many cases, it may make the most sense to have a shared client with goroutines for inbound communication much like I use in gomemcached for communicating with the actual storage layer.
Of course, this isn't the only way. Perhaps you'll find something better as you experiment.