tcp

GetExtendedUdpTable and Remote Ip Address

I've got some c# code that is mapping processes to ip addresses, I'm basically trying to write some software that will look at a process and give me the ip address so that I can write a monitor that will allow friends to find be in games. When running my application though it detects that a game process has a UDP connection but I can't ...

How to correctly pass XML strings between a custom TCP client / server?

Hello, I'm working on a C++ client/server project where XML strings are passed over a TCP/IP connection. My question is about the proper way to indicate the complete string has been received. I was thinking of null terminated strings or sending the length of the XML string first, so the client/server can tell when a complete string is ...

Running graphics display on multiple systems, keeping synched.

I have a series of systems on a LAN running a synchronized display routine. For example, think of a chorus line. The program they ran is fixed. I have each "client" download the entire routine, and then contact the central "server" at fixed points in the routine for synchronization. The routine itself is mundane with, perhaps, 20 pos...

Are non blocking IOs still an issue with server side Java?

The Java NIO Socket Framework supposedly hides the dirty details of non-blocking IO from developers, allowing them to build highly scalable applications, which can handle over 10000 incoming and outgoing sockets using only one thread. Are non blocking IOs still a pain with the typical version of Java 2 SE/EE? Is this framework still ne...

Server Side Language for Scalable TCP-socket application

Which amongst these would be well suited for a scalable server side TCP socket based Web application. Java, PHP, Perl, Python, Ruby. You could base yours answers Primarily on: Rapid Application Development. Available frameworks(If required) for getting the job done. Secondarily on: Performance Support In addition you could a...

Does HttpsURLConnection.getOutputStream() retry on connect timeout?

I was having a problem where HttpURLConnection.getOutputStream() took 2-3 seconds. I set the connect timeout using HttpURLConnection.setConnectTimeout, expecting a SocketTimeoutException (wrapped by IOException) to be thrown from getOutputStream(), so I could retry the whole operation on another server. Instead, it just works now. Does ...

connection reset by peer

What is the meaning of the "connection reset by peer" error on a TCP connection. Is it a fatal error or just a kind of notification ? ...

Is Socket.SendAsync thread safe effectively?

I was fiddling with Silverlight's TCP communication and I was forced to use the System.Net.Sockets.Socket class which, on the Silverlight runtime has only asynchronous methods. I was wondering what happens if two threads call SendAsync on a Socket instance in a very short time one from the other? My single worry is to not have intermix...

How to send/receive nmea string over tcpip/udp

Hi there! I have a gps receiver, which can send data (using gprs connection) to the server www.example.com. Now I need something to receive this data (gps nmea string) from www.example.com (probably, to listen to certain port..), parse this information and store it to my database. I have some knowledge of php and mysql. So, the questi...

Continuous data handling through TCP

I need to handle continuous data through TCP and write it to database. I use the following code (suggested by ZZ Coder): <?php $fp = fsockopen ("192.168.0.179", 2323); if (!$fp) { die ("$errstr ($errno)"); } if ($fp) { $user="root"; $password="12345"; $database="db_name"; mysql_connect('localhost',$user,$password...

Java sockets and TCP tuning

Hello, I try to develop a file transfer application in Java, with an applet as client, and a standalone java app as server (on a dedicated machine hosted in a datacenter). I use DataOutputStream/DataInputStream to transfers the data on both sides. When I send big volumes of data, the bandwith is very variable : all is okay first, then t...

Is it safe to issue blocking write() calls on the same TCP socket from multiple threads?

Let's say I have two threads, T1 and T2. Thread T1 makes a blocking write() call on a TCP socket S to send a large buffer of bytes B1. The buffer of bytes B1 is so large that (a) the write call blocks and (b) TCP has to use multiple segments to send the buffer. Thread T2 also makes a blocking write() call on the same TCP socket S to se...

Doubt in Three way handshake in TCP and Unix listen function

Connect function returns after sending the last ACK(3rd segment of 3-way handshake of initiating TCP connection). What happens if this 3rd segment is lost because listen is still waiting for ACK at server but there is no one at client to send that ACK again ? ...

Performance comparison TcpClient vs HttpWebRequest

I'm posting an XML string to a port on an AIX box. I have two ways in which I'm connecting to this box (TcpClient & HttpWebRequest). I have timers in place to give me an idea how long it is taking the AIX box to process my request and respond. It appears that the TcpClient is faster than the HttpWebRequest by up to 100 milliseconds. I s...

What is a TCP window update?

I'm making my own custom server software for a game in Java (the game and original server software were written with Java). There isn't any protocol documentation available, so I am having to read the packets with Wireshark. While a client is connecting the server sends it the level file in Gzip format. At about 94 packets into sending ...

silverlight tcp tunneling / bridging

I have an application that I develop in Silverlight and it must connect to another legacy app that I cannot control which demands TCP connection on the 3005 port. I can't modify the legacy app to bring the port in the silverlight accepted range (4502 - 453x). Is there a bridging app / another solution that would listen on a configurabl...

HTTP persistent connection vs TCP socket connection

From this article on Wikipedia: Keepalive messages were not officially supported in HTTP 1.0. In HTTP 1.1 all connections are considered persistent, unless declared otherwise. Does this mean that using this mechanism I can actually simulate a TCP socket connection? Using this can I make a Server "push" data to a clie...

TCP flags present in the header

Hi, on my ubuntu 9.04 the /usr/include/netinet/tcp.h defines the tcp header as follows struct tcphdr { u_int16_t source; u_int16_t dest; u_int32_t seq; u_int32_t ack_seq; # if __BYTE_ORDER == __LITTLE_ENDIAN u_int16_t res1:4; u_int16_t doff:4; u_int16_t fin:1; u_int16_t syn:1; u_int16_t rst:1; ...

Simple TCP server using select(), why is "longest request" so high?

I am implementing a simple TCP server using the select() method - everything is fine and performance is quite acceptable, but when benchmarking with ab (apachebench) the "longest request" is insanely high compared to the average times: I am using: ab -n 5000 -c 20 http://localhost:8000/ snippet: Requests per second: 4262.49 [#/sec]...

How to create an application in J2EE which listends for an incoming request on TCP/IP socket?

I need to have a business logic running inside Glassfish 2.1 Appserver, which listens for inbound TCP connections and serves them. I feel that this kind of task is not really fit inside the appserver - maybe I should publish web service interfaces, etc, but I can't, at least not directly for the client. The client will connect to my app...