sockets

C# Socket, time elapsed during sending

Hello. I'd like to know if there was a way to know the time elapsed during the travel of a data on the network. For example, I send a packet from computer A to computer B and C (so elapsed time might be different for each depending on the distance, etc), and I want to know the time between sending and receiving for each client (to sync...

Java - Strange hanging socket?

I have a client-server application with a java server. It works pretty much perfect, except that after an extended period of time, all of a sudden, a socket keeps hanging. This socket is but one of many, the rest seem to do fine still, but once it gets to the socket, the server simply does not go past the sending line. These are the rele...

Binary stream 'NN' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization

I am passing user defined classes over sockets. The SendObject code is below. It works on my local machine, but when I publish to the WebServer which is then communicating with the App Server on my own machine it fails. public bool SendObject(Object obj, ref string sErrMsg) { try { MemoryStream ms ...

Capture Raw NIC IO from .NET Socket as a .NET BitArray

Hi all, I want to master certain raw protocols to learn about TCP Stream resuming. I am versed in .Net sockets, and would like to initiate a TCP stream so: Socket socket = new Socket(Tcp) socket.connect(IPAddress); socket.send(new byte[]{155}); socket.close(); Then be able to read the raw IO network card data sent/recieved and save ...

EAGAIN error for accept on blocking socket

I am using a blocking socket to accept connection. I rarely get this error which makes it hard to debug. The accept returns with EAGAIN error. How can that be for a blocking socket? ...

inter-process communication on local machine using socket in perl and c#

Hi: I am working on a c# application that spawn new Processes to run Perl programs: I was wondering if there is a way to use socket interface to let perl program to talk to c# application. If using socket, the address has to be local host: 127.0.0.1? How to choose which port number to use? also, Since the C# application spawn a Proce...

Forcing a WWAN connection on iPhone, even when Wi-Fi is available

I need to make a network connection over WWAN (i.e. the mobile network) on an iPhone, even when the device is connected to a Wi-Fi network, however I can't find a way to do this. I've tried going down to the socket level and iterating through the available interfaces, however when connected to Wi-Fi, the WWAN interface (pdp_ip0) disappe...

C#: How do I terminate a socket before Socket.BeginReceive calls back?

I have a server that receives connection requests from clients. This server makes use of the asynchronous Socket.BeginReceive and Socket.EndReceive method. The code is pretty similar to the code found here. In my case, after calling Socket.BeginReceive I need a timeout such that if the client hangs on to the connection but does not tra...

How to pass sockets created to another Java Process

Hi; We have an application which creates many sockets which belongs to its thread, By design if this application somehow fails, all threads stop which is not wanted. So to overcome this issue, each thread must be separated from the main application, if one of the threads fails, the other ones should be running. One thing in our mind is t...

Ajax Push Engine (APE) - Sockets question

I was looking into APE and they have a socket library that creates a socket server. Is there a tutorial on how to go about creating this so that the socket server is always running? and how well does it scale? ...

How to get the LAN IP that a socket is sending (linux)

Hello, I need some code to get the address of the socket i just created (to filter out packets originating from localhost on a multicast network) this: socket.gethostbyname(socket.gethostname()) works on mac but it returns only the localhost IP in linux... is there anyway to get the LAN address thanks --edit-- is it possible to ge...

Cygwin in Visual Studio

I'm trying to port an old program I wrote for class from KDev in Ubuntu to Windows Visual Studio 2008 using Cygwin as a personal learning exercise. I have the include path configured to include C:\cygwin\usr\include but it doesn't read the .h files properly. Namely I'm curious as to how one would go about using unix sockets.h functional...

How to pass data as XML via sockets ?

Hi, Could someone please help and provide me links where I can find materials/examples describing how to exchange data in the form of XML schemas between socket programs written in C/C++? Actually I have two software tools running in different OSs, in which I coupled with socket programs written in c/c++. As both work with xml, I am loo...

How could I know that BeginAcceptSocket callback needs IAsyncResult parameter?

Hi, I am curious where can I find out that AcceptClient as a callback of BeginAcceptSocket needs to have IAsyncResult as a parameter. In the MSDN article there is only mentioned that return value of BeginAcceptSocket is IAsyncresult. But how could I know that it has to be passed to callback? Thanks! public server(int port) { ...

C# send structure objects through socket

i have done a bit of reading in client/server programming in c#. i am familiar enough with this process to ask the following question: how do i transmit structure objects through tcp/ip instead of just strings? my app is a networked game with chat capabilities. so instead of just transmitting text, i would like to imploy a data structu...

how to pass xml schema through sockets ?

Hi Could someone please help and tell me if there is a possibility to pass an xml schema through a socket program written in C/C++ ? here is an example: ---- c/C++ ---- ... struct zone { // as an example char *Var_name="xxx"; float var_value = 1.3; }; ----- xml --- ... <xs:element name="zone"> <xs:complexType> <xs:sequence>...

How to add web-services as a layer on the top of sockets written in C/C++?

Is it possible to exchange web-services over socket programs written in C/C++? The data to exchange are in the from of xml/soap message. ...

Python send cmd on socket.

Hi I have a simple question about Python: I have another Python script listening on a port on a Linux machine. I have made it so I can send a request to it, and it will inform another system that it is alive and listening. My problem is that I don't know how to send this request from another python script running on the same machine (...

sendfile() completion to non-blocking socket

Hi, In my program, I need to check the completion of a sendfile() operation in a non-blocking socket. How can that be done? After checking the documentation and searching on internet, I couldn't find out how to do it ...

BSD socket compatible wrapper around winsock?

I'm attempting to port a Linux application to Windows. The application isn't too complex, using all fairly standard code, with few external dependencies. The main dependencies are libelf (which compiles fine under mingw), pthreads (there appears to be a win32 version available), and sockets. The main problem is with sockets...Windows pro...