sockets

Talk to USB device and vice versa from Flex

My co-worker is challenged with taking user input in Flex and using that data to execute commands on a USB device. We figured we would need to have a socket server running on the machine in order to do this. We want to send objects with byte arrays etc, not just strings. Is there anything out there that could help us? Do we need to writ...

Was can be the cause of java.net.SocketException: recv failed: Insufficient buffer space?

A customer receive the error "java.net.SocketException: recv failed: Insufficient buffer space" on windows. With the netstat command we see only approx. 100 socket connections. I have change the MaxUserPort to 60000 like described at http://support.microsoft.com/default.aspx?scid=kb;EN-US;196271 I know that this Java error is equals to ...

How to use socket based client with WCF (net.tcp) service ?

I have developed a WCF service that uses the net.tcp adapter and listens to a specific port. I want to connect to that service using a normal .net client that uses sockets to send data to the port and listens to responses. When I try to send data to this service, I get the error: "The existing connection was forcibly closed by remote hos...

How much overhead does SSL impose?

I know there's no single hard-and-fast answer, but is there a generic order-of-magnitude estimate approximation for the encryption overhead of SSL versus unencrypted socket communication? I'm talking only about the comm processing and wire time, not counting application-level processing. Update There is a question about HTTPS versus HT...

Releasing bound ports on process exit

How do I make sure that a socket bound to a port is properly release on process exit such that the port can be reused without bind() failing with EADDRINUSE? I've written a tiny program which just creates a socket, binds it to a fixed port, waits for a connection and then immediately terminates. When I rerun the program, the bind() call ...

What causes Python socket error?

File "C:\Python25\lib\SocketServer.py", line 330, in __init__ self.server_bind() File "C:\Python25\lib\BaseHTTPServer.py", line 101, in server_bind SocketServer.TCPServer.server_bind(self) File "C:\Python25\lib\SocketServer.py", line 341, in server_bind self.socket.bind(self.server_address) File "<string>", line 1, in...

How to get Maximum bytes from a port using a serversocketchannel

hi guys, I'm developing a multiple port reading application using nio package.Actually these ports recieve packets continously.Using nio package we have to reAD packets using channels.There should not be a packet loss.Here is my code.I've confusion in else if ((key.readyOps() & SelectionKey.OP_READ)== SelectionKey.OP_RE...

Sending Large Data > 1 MB through Windows Sockets viz using the Send function

Hi all, I am looking to send a large message > 1 MB through the windows sockets send api . Is there a efficient way to do this , i do not want to loop and then send the data in chunks . I have read somewhere that you can increase the socket buffer size and that could help . Could anyone please elobrate on this . Any help is appreciated ...

How to discover the reason Socket.Select() reporting an error.

Hey. I call Bind() and then Listen() on a System.Net.Sockets.Socket. None of these calls throw an exception. Later, I make a call to: Socket.Select(myreadlist,mywritelist,myerrorlist,0); with myreadlist and myerrorlist containing the socket in question. Select reports my socket as having had an error, by leaving the socket in errorL...

WSACleanUp causes an exception

My app can switch between Serial and Socket connections, but neither can be open at the same time. So when I try to switch between a Socket to Serial, I delete the Socket connection. The socket based object uses a private class called UsesWinsock (a big shout out to Len Holgate here as it is basically his code (it is RAII actually but I...

Indy 10 IdTCPClient Reading Data using a separate thread?

Hi All, Question: What I'm looking for is the most typical or best practice way to use a separate thread to receive data using an IdTCPClient in Indy 10. Background: The below code is a sample of what I'm trying to do with the actual data processing parts removed for clarity. The Idea of the Thread is to receive all data (Variable siz...

Raw socket implementation in windows?

I need to create TCP/IP headers manually for my application. For that i used Raw socket. My system os is win xp (SP3). My code compiles fine :) but it throws a run time error: Initialising Winsock...Initialised successfully. Creating Raw TCP Socket...Raw TCP Socket Created successfully. Setting the socket in RAW mode...Successful. E...

Why am I getting this SocketException in my C# service?

I have a service that is responsible for reading and writing from a server. The reading and writing is done in different threads. The reader thread is active all the time whereas write thread only activates to send message and dies once message is written to server and response is received. The service runs for 4 days and after that I ...

How to write socket communication program using win32

New guy want to learn about socket programming in win32. I know bit of MFC but thats not good point to start as it just hides the internal details form programmer. ...

socket_create vs. fsockopen php

The hosting service that I use currently does let me use sockets, probably for good reason on their part. They do, however, let me use fsockopen. I was wondering what the difference is, because some scripts that worked with socket_create and even stream_socket_server, do not work with fsockopen. That said, if fsockopen should work, my co...

Linux: How do I force a specific network interface to be used?

This could be considered a continuation of this earlier SO question. Ideally, I'd like to jail a process into only using a certain interface, no matter what. It will be making TCP connections, sending UDP datagrams, and listening for UDP broadcasts. Currently, what I am doing is: Determine the IP of the interface to use. Create an IP ...

Cancelling a Socket.xxxxAsync call

After calling Socket.Shutdown, Socket.Close and Socket.Disconnect, it appears that Socket.ReceiveAsync does not abort. Attempts to reuse the SocketAsycEventArgs object used in the ReceiveAsync call (suggested in the documentation as best practice) result in the error: An asynchronous socket operation is already in progress using this...

pselect() not recognizing the socket having any IO activity

take for instance the following code snippet, the creation of the socket, listening and acceptance of a new socket works fine. The non-blocking mode is also working, however the pselect (or even replacing with select) is not recognizing any IO requests ready on the FDset. so the return value is always 0 (timed out). I was wondering if...

Single socket multiple clients architecture

I have to maintain a single persistent socket connection to a payment gateway and use it to send financial messages and receive confirmation for the same. My application will be then used by various clients and so I need to devise a way to handle them concurrently and handle issues such as timeouts and retries etc. Right now, my main ...

max value for SO_RCVBUF in Windows?

Quick question, wondering if anyone knew what the limit is for SO_RCVBUF under Windows. ...