sockets

How can the SO_RCVBUF be smaller than the TCP receive window? (Windows XP)

I have an application using TCP on Windows XP. When I call getsockopt with the SO_RCVBUF option, it reports 8192 bytes. However, Wireshark shows the app advertising a receive buffer of 64K. How is this possible? To have a 64K receive window, doesn't it need a 64K buffer? Are there two different buffers? ...

Where is the best place to start learning Java Socket Programming?

I wish to create a Java Socket server which can be connected to using Javascript and/or Flash. I have experience in Connecting to sockets in flash, and using a comet like system in Ajax. I wish to make a live communication system, which will intale multiple connections to the server from various clients, needing almost instant communicat...

Limiting max speed of sockets

I'm using raw sockets on windows and I'm trying to find a way to limit the max connection speed over a group of sockets. For example I have 3 sockets to 3 servers and want to limit total download speed to 1mb. I googled and cant find any thing related. Any ideas? ...

udp can not receive any data

Here is my code Socket sck = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); sck.Bind(new IPEndPoint(IPAddress.Any, 0)); // Broadcast to find server string msg = "Imlookingforaserver:" + udp_listen_port; byte[] sendBytes4 = Encoding.ASCII.GetBytes(msg); IPEndPoint groupEP = new IPEndPoint(IPAddress.Parse("25...

How can I send an std::vector<std::string> over a UNIX socket?

For my application, I need to be able to send an std::vector<std::string> over a UNIX socket(local), and get a copy of the vector on the other end of the socket. What's the easiest way to do this with O(1) messages relative to the size of the vector(i.e. without sending a message for each string in the vector)? Since this is all on the ...

Code Own Socket Server or Use Red5/ElectroServer on Amazon EC2?

I've been thinking for a long time about working on a multiplayer game in Flash. I need updates frequently enough that ajax requests won't work so I need to use a socket server. The system will eventually have enough objects/players that I would consider it an MMO. I would like to set up a scalable system on Amazon's EC2. (Which prob...

Sending jpegs by tcp socket...sometimes incomplete.

Vb.net Hi I've been working on a project for months now (vb 2008 express). There is one final problem which I can't solve. I need to send images to a client from a 'server'(listener). The code below works most of the time but sometimes the image is incomplete. I believe this might be something to do with the tcp packet sizes varying, ...

download file only with sockets

Hi I want to write a simple client on the iPhone that downloads a file from an http server using only bsd sockets. I searched the web but couldn't find anything helpful. Can you give me a direction? Thanks Alex ...

Why do socket.makefile objects fail after the first read for UDP sockets?

I'm using the socket.makefile method to create a file-like object on a UDP socket for the purposes of reading. When I receive a UDP packet, I can read the entire contents of the packet all at once by using the read method, but if I try to split it up into multiple reads, my program hangs. Here's a program which demonstrates this proble...

Any way to get read timeouts with Java NIO/selectors?

I'm converting a Java server application which used blocking IO and thread-per-client to NIO and a single IO thread (probably a thread pool after I get the basic implementation done). The one thing I am having an issue with is disconnecting clients after they have been idle for a period. I had previously been using SO_TIMEOUT and block...

establishing a socket connection from iPhone to Mac/PC

I just started getting into XCode and Co. What I am trying is to send accelerometer data via WLAN to a PC or Mac over a socket connection. I am trying at the moment with the iPhone simulator, on the other site a netbook with a Java program shall receive a test string for starters. Unfortunately my socket will not initialize. What am I do...

FTP connection (Java)

Hello, when I connected to a FTP-Server with sockets how can I send username and password? thank you for your answers. ...

CAsyncSocket and ThreadPool problem

I have a server application with such structure: There is one object, call him Server, that in endless cycle listens and accepts connections. I have descendant class from CAsyncSocket, that has overriden event OnReceive, call him ProxySocket. Also I have a thread pool with early created threads. When connection is received by server obj...

How to check if a socket is connected/disconnected in C#?

I'm writing an emulator for a game and one of the functions is "SendToAll". How can I check which sockets are still connected? (The client doesn't send a Logout/Disconnect packet.) ...

Can I ran 2 or more Tcp Sever applications on one computer?

Hi all. I have a client-server Silverlight application, which is use Socets. I have server appliaction on may computer(Win Form application) and client applucation as web site(Silverlight application). I use policy server which open port 943. Everything works fine on this application. But now I need to write another client-server applica...

Multiple sendto() using UDP socket

Hi, I have a network software which uses UDP to communicate with other instances of the same program. For different reasons, I must use UDP here. I recently had problems sending huge ammounts of data over UDP and had to implement a fragmentation system to split my messages into small data chunks. So far, it worked well but I now encoun...

Getting a UDP socket program in Python to accept messages from a Syslog client?

I'm trying to write a Syslog listener and so far so good on getting it to accept incoming messages through TCP but I also want UDP to function. This is the UDP server code I'm using, which works using a python client app. I also have another app which also works just using the python client app. # Server program # UDP VERSION from so...

Can I make a "TCP packet modifier" using tun/tap and raw sockets?

I have a Linux application that talks TCP, and to help with analysis and statistics, I'd like to modify the data in some of the TCP packets that it sends out. I'd prefer to do this without hacking the Linux TCP stack. The idea I have so far is to make a bridge which acts as a "TCP packet modifier". My idea is to connect to the applicati...

UDP port binding by multiple applications?

I am trying to bind multiple applications running on different PCs across a single LAN. Is it a good idea when all applications are receiving on same port and sending at same port? For example: app1 (receiving at port 10000, sending to some ip2 and port 10000) app2 (receiving at port 10000, sending to some ip1 and port 10000) ...

Qt Sockets and Endianness

Hello I'm writing a program that uses QUdpSocket for transmiting data over the network. This is my first socket program, and I've come across an interesting problem called Endianness. My actual question in, do I have to worry about Endianness when I'm using QNetwork as my sockets library? If I do have to worry, what do I have to do to ...