tcp

Can a TCP checksum produce a false positive? If yes, how is this dealt with?

If a TCP payload gets corrupted in transit the recomputed checksum won't match the transmitted checksum. Great, all fine so far. If a TCP checksum gets corrupted in transit the recomputed checksum won't match the now corrupted checksum. Great, all fine so far. What happens when both the payload and checksum get corrupted and the recomp...

TCP server client issue

First i am n00b in socket programming. So i decided to write simple data over lan tcp server My server code that handles incomming data is private void HandleClientComm(object client) { TcpClient tcpClient = (TcpClient)client; NetworkStream clientStream = tcpClient.GetStream(); clientStream.ReadTimeout = 10; int si...

Need expert's comment on fastest communication for .net application

I am looking to achieve the fastest and scalable communication between several servers. I've developed a custom TCP socket server for this purpose with (IOCP) as I think it would be the fastest communication in .NET, but I don't know if it crashes on high load, or if my solution is the fastest communication channel for .NET applications....

Thread type for TCP Accept loop: BackgroundWorker, Thread, or ThreadPool

I'm writing a TCP server, and at the very heart of it is a fairly standard bind-listen-accept piece of code nicely encapsulated by TcpListener. The code I'm running in development now works, but I'm looking for some discussion of the thread model I chose: // Set up the socket listener // *THIS* is running on a System.Th...

Linux low latency tcp stream.

I have an embedded application that has this requirement: One outgoing TCP network stream need absolute highest priority over all other outgoing network traffic. If there are any packets waiting to be transferred on that stream, they should be the next packets sent. Period. My measure of success is as follows: Measure the high prior...

How to build a TCP pseudo header and related data for checksum verification in C and libpcap?

I'm trying to build up the proper data structure using a pseudo tcp header, tcp header, and tcp data to be sent to a check sum function to be verified. I cannot figure out what I'm doing wrong in my code. The following code is my function that builds up the data structure and then sends it to another function to be checked. void print_...

Is TCP suitable for network game programming consisting of regular positional updates?

Hey guys, Suppose you were forced to use TCP sockets over UDP sockets (ie: something that Silverlight insists on). Would it be possible to create a multiplayer game that involves sending real time positional updates to up to say eight players so that each player could accurately see every other player in real time, even though UDP would...

Closing a listening TCP socket in C

Hi; Suppose you have a socket listening on a TCP port, and some clients are connected. When one issues sock_close(fd) in C and tries to bind again on the same port, binding fails. Some TIME_WAIT state is seen on the "netstat -plutnoa" such as: tcp 0 0 127.0.0.1:4567 127.0.0.1:32977 TIME_WAIT - ...

Starting a Process When a Port is Connected To

I want to create a single client that issues unicast requests for data from any of many workstations on the same LAN. The client will likely run Linux, but the workstations may run any OS. Is it possible to avoid running a daemon on each of the workstations and yet have them reply to requests within a few seconds? I want to avoid creatin...

How to set the maximum TCP mss (Maximum Segment Size) on Linux?

A simple question: In Linux, how do you set the maximum segment size that is allowed on a TCP connection? I need to set this for an application I did not write (so I cannot use setsockopt to do it). I need to set this ABOVE the mtu in the network stack. Here's why: I have two streams sharing the same network connection. One sends s...

WCF inner exception message "A registration already exists for URI 'net.tcp://....' " when trying to support a dual LAN from a WCF service

I have a self-hosted WCF service which is using the net.tcp protocol for an endpoint and it works fine on a PC with a normal LAN card. However, I want to support PCs which have dual LAN cards and this gives me problems. I have assigned different IP addresses to the two cards (192.168.1.1 and 193.168.1.1). I then changed my app.config fi...

TcpConnection and WcfProxy

Hi, When I dispose wcf client proxy, is TcpConnection still available? (netTcpBinding has been used) ...

WCF TCP client with Java Socket server on custom XML messages

I am trying to build a WCF client for a Java Socket server which talks on a custom XML messages. I have created my own custom binding with MessageEncoder and netTCP transport. Now what I have seen happen is on the first call to the server, server accepts the connection. However the server then waits for a specific XML packet. This is bu...

How many TCP connections can Ruby deal with ?

I have a general ubuntu server, and I want to use Ruby to deal with many TCP requests, I want to know how many connections it can handle. ...

Why will a TCP Server send a FIN immediately after accepting a connection?

From the ethreal packet capture, I see the following behaviour which appears quite strange to me: Client --> Server [SYN] Server --> Client [SYN, ACK] Client --> Server [ACK] Server --> Client [FIN, ACK] Client --> Server [ACK] Client --> Server [TCP Segment of a reassembled PDU] (I don't know what this means) Server --> Client [...

Is it good to open multiple ports on TCP server?

The Tcp server need to serve many clients, If one client one server port and one server thread to listen the port, I want to know weather it is faster ? If one port is good, could someone explain the different between one port and multiple ports in this case, thanks! ...

In python is there a cross-platform way of determining what process is listening to a given port?

In linux, I can use lsof -i as in the following function: def FindProcessUsingPort(portnum): import os fp = os.popen("lsof -i :%s" % portnum) lines = fp.readlines() fp.close() pid = None if len(lines) >= 2: pid = int(lines[1].split()[1]) return pid Is there a cross-platform way to figure this out? ...

Why would connect() give EADDRNOTAVAIL?

I have in my application a failure that arose which does not seem to be reproducible. I have a TCP socket connection which failed and the application tried to reconnect it. In the second call to connect() attempting to reconnect, I got an error result with errno == EADDRNOTAVAIL which the man page for connect() says means: "The specifie...

The order of TCP message?

I'm developing C++ application server and client which use TCP. I have three messages on server: A, B and C. They are sent sequentially: A -> B -> C. And clients responses acknowledge messages:rA, rB, rC. Do client receive A, B and C in order A->B-C? Do server receive rA->rB->rC? Thanks in advance ...

Is it possible to connect to SSH using JavaScript?

I know there is an implementation of VNC using WebSockets (http://novnc.com) but that still requires a server. I am looking to create a simple client-side JavaScript only (no Flash) connection to a port running SSH. I am guessing WebSockets is the only way to go since it does TCP. Any example code? Any other way? ...