tcp

python httplib and broken tcp connection

How do I find out if a connection has been broken using the httplib library? Seems like something so basic yet I can't find the answer on here or google. ...

Benefits of "Don't Fragment" on TCP Packets?

One of our customers is having trouble submitting data from our application (on their PC) to a server (different geographical location). When sending packets under 1100 bytes everything works fine, but above this we see TCP retransmitting the packet every few seconds and getting no response. The packets we are using for testing are about...

tcp msl timeout implementation in linux

The following is given in the book TCP IP Illustrated by Stevens Quiet Time Concept The 2MSL wait provides protection against delayed segments from an earlier incarnation of a connection from being interpreted as part of a new connection that uses the same local and foreign IP addresses and port numbers. But this works ...

Programatically determining maximum transfer rate

I have a problem that requires me to calculate the maximum upload and download available, then limit my program's usage to a percentage of it. However, I can't think of a good way to find the maximums. At the moment, the only solution I can come up with is transfering a few megabytes between the client and server, then measuring how lin...

python httplib httpexception error codes

Does httplib.HTTPException have error codes? If so how do I get at them from the exception instance? Any help is appreciated. ...

rails server stuck in close_wait and requires a re-start once in a while

I have a rails webapp which internally connects to another request server. At times , ruby process gets stuck in close_wait state and stop responding and needs a restart. i guess this happens only when the request server which the rails app connects to is restarted. But am not completely sure of it. Any help appreciated on how should i g...

[java] Threading socket handler for two sided communication in tcp port

I want to make a chat which will be programed in java. one computer will host the server and the other one will initiate the socket [tcp port]. now from what I read there should be a loop that will constantly read the socket which means it will make the code stuck. I have a button that is 'actionperformed' on mouse release, I want to kno...

TCP socket communication

hello, I am creating a Chat in java. I have a method (onMouseRelease) inside an object that creates a tcp server and waits for a socket like this: ServerSocket server = new ServerSocket(port); Socket channel = server.accept(); Now I want to make a thread that will loop and read data from the socket, so that once the user on the oth...

Ruby TCPSocket read_all

Is there a method that can act like read_all, as in instead of using TCPSocket.read(no_of_bytes), one can simply TCPSocket.read_all. I am sending objects first by YAML::dump'ing them then sending them but I don't know a way to get their size in bytes. Thanks in advance, ell. Oh and I am very, very new to any form of network programming s...

TCP and UDP are using different OS Buffer?

HI all. Here is the scenario. I have port 8888 for my program to use. I build a TCP and a UDP listener on that port. (This can do, c# allows, because they are two different protocols) My question is If the network traffic is very busy, TCP sockets may refuse or signalling the other end to stop sending things, it is called congestion...

Wireshark doesnt' recognises RTMP streams

Hello! I found on the web few samples on tracking RTMP (Real Time Messaging Protocol) with Wireshark, but it doesn't work for me. All RTMPT packets rendered as basic TCP packet like this: 149 14.324999 85.115.xxx.xxx 192.168.1.20 TCP macromedia-fcs > 54557 [ACK] Seq=1 Ack=1452 Win=69 Len=0 I'm using Wireshark 1.2.8 with all prot...

how to send data to server with the same TCP connection using ajax or JS trick

Hi, I know how to keep a connection indifinetely open server side to stream continuously data to javascript. BUT I do not know how to send data reusing the same TCP from browser to server. so there is not the 3 way handshake and only 2 tcp packets. I know it is possible but I do not how to do it : use xmlhttprequest? or script tag ajax ...

Maximum number of bytes that can be sent on a TCP connection

I initially assumed that since tcp has a sequence number field of 32 bits and each byte sent on a tcp connection is labeled with a unique number, maximum number of bytes that can be sent on a tcp connection is about 2^32-1 or 2^32-2 (which?). but now I feel that since TCP is a sliding window protocol, the wraparound of sequence numbers ...

Interrupting the TCP handshake with PHP's fsockopen()?

Take for example: fsockopen(tcp:\\example.com, 80, $errno, $errstr, 5) My friend has just informed me that PHP will always wait for the TCP handshake to be completed before closing the socket. However, I find it difficult to believe that PHP can't interrupt the handshake. Is it possible? If so, how? ...

Listening for TCP and UDP requests on the same port

I am writing a Client/Server set of programs Depending on the operation requested by the client, I use make TCP or UDP request. Implementing the client side is straight-forward, since I can easily open connection with any protocol and send the request to the server-side. On the servers-side, on the other hand, I would like to listen b...

Odd tcp deadlock under windows

We are moving large amounts of data on a LAN and it has to happen very rapidly and reliably. Currently we use windows TCP as implemented in C++. Using large (synchronous) sends moves the data much faster than a bunch of smaller (synchronous) sends but will frequently deadlock for large gaps of time (.15 seconds) causing the overall trans...

How to retain one million simultaneous TCP connections?

I am to design a server that needs to serve millions of clients that are simultaneously connected with the server via TCP. The data traffic between the server and the clients will be sparse, so bandwidth issues can be ignored. One important requirement is that whenever the server needs to send data to any client it should use the exist...

Determine if a server is listening on a given port

I need to poll a server, which is running some propriatary software, to determine if this service is running. Using wireshark, I've been able to narrow down the TCP port its using, but it appears that the traffic is encrypted. In my case, its a safe bet that if the server is accepting connections (i.e. telnet serverName 1234) the servic...

get open TCP port in Python

I want to get any random open TCP port on localhost in Python. What is the easiest way? ...

Secure password transmission over unencrypted tcp/ip

I'm in the designing stages of a custom tcp/ip protocol for mobile client-server communication. When not required (data is not sensitive), I'd like to avoid using SSL for overhead reasons (both in handshake latency and conserving cycles). My question is, what is the best practices way of transmitting authentication information over an ...