sockets

How to enumerate bound UDP / TCP sockets on Windows in C

Assuming that you do not have access to the SOCKET handlers. ...

Stopping a TcpListener after calling BeginAcceptTcpClient

I have this code... internal static void Start() { TcpListener listenerSocket = new TcpListener(IPAddress.Any, 32599); listenerSocket.Start(); listenerSocket.BeginAcceptTcpClient(new AsyncCallback(AcceptClient), null); } Then my call back function looks like this... private static void AcceptClient(IAsyncResult asyncResul...

Using NSStream to communicate with PHP?

I'm working on an iPhone project that needs to receive data from a PHP script during execution. My first thought was to use sockets/streams on either end to connect the two, but I am having trouble finding information on how to do this from the iPhone side. Has anyone been down this path that could point me towards some useful resources...

Specify source IP address for TCP socket when using Linux network device aliases

For some specific networking tests, I've created a VLAN device, eth1.900, and a couple of aliases, eth1.900:1 and eth1.900.2. eth1.900 Link encap:Ethernet HWaddr 00:18:E7:17:2F:13 inet addr:1.0.1.120 Bcast:1.0.1.255 Mask:255.255.255.0 eth1.900:1 Link encap:Ethernet HWaddr 00:18:E7:17:2F:13 inet...

Is a client-server setup a good way to move data between machines?

I need to move some data from one machine to another. Is it a good idea to write a client server app using sockets in Perl to do the transfer? Will I have problems if one side is written in Java? I mean, should I be aware of any issues I might face when I try to attempt the above? ...

java socket send & receive byte array

in server, I have send a byte array to client through java socket byte[] message = ... ; DataOutputStream dout = new DataOutputStream(client.getOutputStream()); dout.write(message); How can I receive this byte array from client? anyone give me some code example to do this thanks in advance ...

Help with Sending/ Receiving UDP packets - C Sockets

Ok, if you look at some of my previous questions, I've been working on getting a simple connection up and running with C sockets (I'm still fairly new to the whole networking aspect of an program, but everyone has to start somewhere, right?). I've included the code below that I have so far and when I execute it, I get no errors, but at t...

Why no "what's my ip" well-known port/service?

I know there are some web sites that provide this service but given that pretty much everyone lives behind NAT these days, why isn't this standardized on a port and provided as a service to whomever wants to run it? It's at least as useful as an echo, daytime or "quote of the day" server and as easy to implement. Or does one exist that...

How should a HTTP server (using sockets) detect that the client is no longer connected and abort processing?

I'm implementing a basic HTTP Server in C++, using boost::asio. As I process each request, I write out the data in chunks, asychronously. If at any point I knew the client was no longer connected, I'd like to abort the processing, e.g. there's no point continuing to build results up to send out if the client is no longer there. I thin...

Spoofing the origination IP address of an HTTP request

This only needs to work on a single subnet and is not for malicious use. I have a load testing tool written in Python that basically blasts HTTP requests at a URL. I need to run performance tests against an IP-based load balancer, so the requests must come from a range of IP's. Most commercial performance tools provide this function...

Is it feasible to develop a chat app using php sockets?

Hi, I'm looking to develop a chat application using php sockets, I'm not looking to include database as a bridge between nodes, reason being the amount of database interaction will ultimately be an overhead..Pls suggest.. ...

Sockets - send and receive

Hey, I'm currently writing a chat server in C++. When a user connects to it, I open a socket and I create two threads, one to receive and one to send data. Now my question: Do I have to check if the other thread is currently using the socket, or will the send/recv function just wait until the socket is ready? Regards, x3ro ...

Speed up my Java tcp transfer!

I need to speed up transfers across my gigabit ethernet connection. Right now, I'm doing something almost exactly like this, but I'm only seeing about 40% of that when I run this code below. I also ran this script on all of my (Mac Pro) machines before testing #!/bin/bash sudo sysctl -w net.inet.tcp.win_scale_factor=8 sudo sysctl -w ...

Hpux telnet using socket

o Sun OS, UTS, AIX etc. But, when the same program is run with HP UX on the other end, we are unable to receive the response from the HP UX box (B.11.31 O/S). sSocket = socket(AF_INET,SOCK_STREAM,0); connect(sSocket,(struct sockaddr *)&sin,sizeof(sin); ierr = read(sSocket,szBuffer,BUF_LEN-1); When the read is called, we get jun...

Java NIO: Relationship between OP_ACCEPT and OP_READ ?

I am re-writing the core NIO server networking code for my project, and I'm trying to figure out when I should "store" connection information for future use. For example, once a client connects in the usual manner, I store and associate the SocketChannel object for that connected client so that I can write data to that client at any tim...

Good Readings on Unix/Linux Socket Programming?

Hi all, though I haven't worked with sockets professionally, I find them interesting. I read some part of Unix Network Programming by Richard Stevens (considered to be the Bible I suppose as it is referred by everyone I ask) but the problem is the examples require a universal header unp.h which is a PIA to use. Can some of you suggest ...

How often is the Silverlight Access policy accessed?

Hi As you may well know, it is required to host an access policy (clientaccesspolicy.xml) on your web server if you want SL apps to perform HTTP requests, or you need to host an access server on port 943 for socket connections. My app makes many short requests and latency is important. I want to know if this access policy file is acce...

Delphi ScktComp: When is the onWrite event being fired?

I have come to the point of thinking that the onWrite Event of a ClientSocket is redundant when I directly write bytes into the socket connection via SendBuf(). Is my point of thinking somewhere in the desert? The Delphi Documentation is also somewhat bad because it just sais: "Write a routine for the onWrite event to write into the so...

How to detect dataloss with Java sockets?

I have the following situation: using a "classical" Java server (using ServerSocket) I would like to detect (as rapidly as possible) when the connection with the client failed unexpectedly (ie. non-gracefully / without a FIN packet). The way I'm simulating this is as follows: I'm running the server on a Linux box I connect with telnet...

Why will socket connection to port 23 not work?

I have this small test socket connection class:- import java.net.Socket; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.IOException; public class TestTelnet { public static void main(String args[]) throws Exception { Telnet telnet = ...