sockets

Receiving MessageQueue msgs without reading them from the receiving Queue?

I am using the System.Messaging.MessageQueue to send and receive multicast System.Messaging.Message’s on my LAN – this works fine. However, I have a requirement to receive the msgs without using a message queue. As the MessageQueue uses the PGM protocol (113) to send messages I am trying to build a type that listens on PGM (protocol 11...

.NET Does NOT Have Reliable Asynchronouos Socket Communication?

I once wrote a Crawler in .NET. In order to improve its scalability, I tried to take advantage of asynchronous API of .NET. The System.Net.HttpWebRequest has asynchronous API BeginGetResponse/EndGetResponse. However, this pair of API is just to get a HTTP response headers and a Stream instance from which we can extract HTTP response co...

In Ruby how can I abort a connection with a RESET?

In any socket API the close() method closes a connection with a FIN. If I want to abort a connection with a RST how can I do it? ...

When is char* safe for strict pointer aliasing?

I've been trying to understand the strict aliasing rules as they apply to the char pointer. Here this is stated: It is always presumed that a char* may refer to an alias of any object. Ok so in the context of socket code, I can do this: struct SocketMsg { int a; int b; }; int main() { ... SocketMsg msgToSend; msgT...

How to debug a disappearing app

On a Windows 2003 server I have a pure .NET 3.5 C# app (no unmanaged code). It connects to various other remote systems via sockets and acts like a data hub. It runs for 10-15 hours fine with no problem but from time to time it just disappears. If I watch the app using task manager the memory usage remains constant. In the Main() functi...

How do I determine all of my IP addresses when I have multiple NICs?

I have multiple Network Interface Cards on my computer, each with its own IP address. When I use gethostbyname(gethostname()) from Python's (built-in) socket module, it will only return one of them. How do I get the others? ...

Socket Exception: "There are no more endpoints available from the endpoint mapper"

I am using winsock and C++ to set up a server application. The problem I'm having is that the call to listen results in a first chance exception. I guess normally these can be ignored (?) but I've found others having the same issue I am where it causes the application to hang every once in a while. Any help would be greatly appreciate...

Is there any benefit to using windows winsock API functions compared to BSD-style socket functions?

Is there any benefit on Windows to use the WSA winsock functions compared to the BSD-style ones? ...

Detecting TCP Client Disconnect

If I'm running a simple server and have accept()ed a connection from a client, what is the best way to tell when the client has disconnected? Normally, the client in this case I supposed to send a close command, but what if it DCs manually? How can I tell or handle this? ...

Tuning socket connect call timeout

Is there any way in a Win32 environment to "tune" the timeout on a socket connect() call? Specifically, I would like to increase the timeout length. The sockets in use are non-blocking. Thanks! ...

Multi-client, async sockets in c#, best practices?

I am trying to gain a better understanding of tcp/ip sockets in c#, as i want to challenge myself to see if i can create a working MMO infrastructure (game world, map, players, etc) purely for educational purposes as i have no intention of being another one of those "OMGZ iz gonna make my r0x0r MMORPG that will be better than WoW!!!", yo...

Trying to send an HTTP request over sockets.

I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object. My onConnect listener is below: function sConnect(e:Event):void { trace('connected'); s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds HTTP/1.1\r\n'); s.writeUTFBytes('Host: 208.43.71.50:8080\r\n'); s.writeUTFBytes('Connect...

irritating select() behaviour in c

while (xxx) { timeout.tv_sec=TIMEOUT; timeout.tv_usec=0; FD_ZERO(&set); FD_SET(sd,&set); switch (select(FD_SETSIZE,&set,NULL,NULL,&timeout)) xxxxx } works fine, however FD_ZERO(&set); FD_SET(sd,&set); while (xxx) { timeout.tv_sec=TIMEOUT; timeout.tv_usec=0; switch (select(FD_SETSIZE,&set,NULL,N...

Are socket connections faster than http on Blackberry?

I'm writing an app for Blackberry that was originally implemented in standard J2ME. The network connection was done using Connector.open("socket://...:80/...") instead of http:// Now, I've implemented the connection using both methods, and it seems like some times, the socket method is more responsive, and some times it doesn't work at...

Java control IP TTL?

In Java, is there a way to control the TTL of the IP header for packets sent on a socket? ...

Decoding chunked HTTP with Actionscript

I have successfully connected to an HTTP server with ActionScript 3 over sockets. The only problem is, the server is sending chunked HTTP. Is there a generic function in any other language I can look at that clearly shows how to decode the chunking? I'm pretty sure there are no ActionScript libraries around for this. ...

receiving data over a python socket

I'm making a program that retrieves decently large amounts of data through a python socket and then immediately disconnects when the information is finished sending. But I'm not sure how to do this All the examples on the web are of tcp clients where they have while 1: data = sock.recv(1024) But this creates a look to infinite loo...

How to set a timeout on blocking sockets in boost asio?

Is there a way to cancel a pending operation (without disconnect) or set a timeout for the boost library functions? I.e. I want to set a timeout on blocking socket in boost asio? socket.read_some(boost::asio::buffer(pData, maxSize), error_); Example: I want to read some from the socket, but I want to throw an error if 10 seconds have ...

Unhandled Socket securityError even when (seemingly) handling it

I Have a problem where I occasionally (i.e. not always) see the below error popup from the Debug Flash Player after launching my app: Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://example.com/myApp.swf cannot load data from localhost:4499. at org.mydomain.mypackage::MyClassUsingSocket() ...

Counterpart of .NETs NetworkStream / SslStream in Delphi 7

I have written a secure TCP server in .NET. This was basically as simple as creating a TcpListener instance and wrapping the connected client's NetworkStreams with SslStreams. Now I need to access this TCP server with Delphi 7 (alternatively: Delphi 2007). I haven't found anything in the help, and a Google search shows up lots of compl...