sockets

Socket programming: sendto always fails with errno 22.

I am always getting no bytes sent, with an errno of 22 (Invalid Argument) with this code. The destination_host is set elsewhere and known to be valid, so I really don't see what is going on. MAXMSGSIZE is 1000. No errors, or warnings. I am compiling with -Wall -Werror -pedantic char *data_rec; u_int data_len; int sockfd; uint16_t *...

Async socket programming and F#

I have a WCF service, which works with sockets async, I have some performance issue so I decided to refactor the code, I read some articles about the ease of use of F# for async and multi threading and so on, but i want to know I'll gain a better performance to use F# parallelism? and its easy compatible with WCF service, I have a large ...

java socket writeUTF() and readUTF()

I've been reading some Java socket code snippet and fonund out a fact that in socket communication, to send messages in sequence, you don't have to seperate them by hand, the writer/reader stream do the things automatically for you. Here is an example: writer.java writeUTF("Hello"); writeUTF("World"); reader.java String a=readUTF(); /...

How to write a .Net UDP Scalable server

Hello StackOverflow! I need to write a very high load UDP server. I'm using .Net. How do I use the Socket class to achieve this? I am familiar with the winsock API, and completion ports, and what i would do there, is to use several threads to accept sockets using a completion port, and also to receive in the same manner. My server nee...

Problem in accepting connection from client (socket programming) in Visual C++

I have written a simple single threaded client server application in Visual C++. When I run my server I wait for some time that it accepts some request from the client. When I connect the client to the server. The log message on the client reports 14 bytes are send and there is no message on the server. I have written a print statement ...

problem in accepting connection from client (socket programming) in VC++.net

Hi Jerry, I have corrected the above syntax error i am having the same problem. nothings appears on my end can u tell me how u are executing the code. i am executing it by simple running first the server and then client in visual stdio 2005. ...

c# socket server and client

Have anyone able to use visual studio socket server and client to work successfully over WAN network and not LAN?? I got it to work on LAN but not over the WAN. ...

HTTP Server Programming

Hello all, I'm attempting to write my own http 1.1 server, just for fun and learning about more about HTTP, sockets, and threading. I've gotten a good start i think with only delivering static pages (using c, which I would prefer to stay in for the time being). I have a test page I wrote a while ago and deliver it's ~50 files in 124ms...

c++ socket stream api

I'm using what looks to be a real nice API for streaming sockets found here: http://www.pcs.cnu.edu/~dgame/sockets/socketsC++/sockets.html. I'm having trouble accessing the IP of the connected user because its a private member of a class "Socket" that is used within another class "ServerSocket". My program looks exactly like the demo on...

Packet sniffer socket exception

Heya, On the following code Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP); s.Bind(new System.Net.IPEndPoint(IPAddress.Parse("127.0.0.1"),0)); s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, true); byte[] bin = new byte[4]{1, 0, 0, 0}; ...

Error 0xc1f30001 when calling asyncListen method of nsIServerSocket interface in Firefox while there is no internet connection

CAN'T REPRODUCE ANYMORE The code below works fine when there is internet connection. var socket = Cc["@mozilla.org/network/server-socket;1"] .createInstance(Ci.nsIServerSocket); socket.init(-1, true, -1); socket.asyncListen(nsIServerSocketBug); However once the computer is disconnected from the internet, I get ...

catching a broken socket in python

I'm having problems detecting a broken socket when a broken pipe exception occurs. See the below code for an example: The Server: import errno, select, socket, time, SocketServer class MetaServer(object): def __init__(self): self.server = Server(None, Handler, bind_and_activate=False) def run(self, sock, addr): ...

Socket Programming with J2ME

Hello , How can i connect to a TcpServer(using ip & port) with J2ME ? i want to send a request to the server and get responses ! ...

Serializing a C# Socket

I'm looking at options for optimizing the number of concurrent connections my socket servers can handle and had an idea that hinges on being able to serialize C# sockets so that they can be removed from memory and then restored as needed. This scenario is only acceptable for me because sessions last for hours and the sockets are used ve...

PHP Communication with C++ Application

I have been searching Google for a while, but the problem I am running into is I am not exactly sure what it is I need to be searching for. (Searching for PHP C++ communication doesn't seem to be what I need) I am basically developing a c++ plugin for a game server, and I would like to create a web interface that can pass/pull data to an...

Socket getting created with same IP and port on local host.

Hi All, I am seeing weird behavior on Linux where I am seeing that remote end and local end are both showing same IP and port combination. Following is the netstat output netstat -anp | grep 6102 tcp 0 0 139.185.44.123:61020 0.0.0.0:* LISTEN 3361/a.out tcp 0 0 139.185.44.123:61021 ...

IP address of network computer

Hi, The program I'm coding connects to another program via a network-API, and I believe it's called a socket connection. I specify the IP: 127.0.0.1, and the Port, which must match what I set in that program. Now, this works fine. But what if I want to have the program running on another computer on a network? I have set up a wirel...

socket programming guide in cocoa

Hi All, Can any one suggest good tutorials regarding socket programming using cocoa ...

Connect clients

Hi I am trying to connect 2 or more computers running a c# application. All TCP examples I find only show how to connect them if they are running on the same network. My question is how to connect them over the internet? I want to create a service like MSN but with direct connection (like a torrent software does), any help? regar...

How can I know, what local port is used by Stream?

Is it possible to specify explicitly local port that should be used by net.Stream, or to find out what local port is used for connection? According to the documentation, local port cannot be specified: stream.connect(port, host='127.0.0.1') ...