sockets

Getting the source address of an incoming socket connection

i have a server with a incoming socket from a client. i need the get the ip addr of the remote client. tried searing google for in_addr but its a bit troublesome. any suggestions? thanks ...

Using a specific network interface for a socket in windows

Is there a reliable way in windows, apart from changing the routing table, to force a newly created socket to use a specific network interface (I understand that bind() to the interface's IP address does not guarantee this)? ...

Does the TCPServer + BaseRequestHandler in Python's SocketServer close the socket after each call to handle()?

I'm writing a client/server application in Python and I'm finding it necessary to get a new connection to the server for each request from the client. My server is just inheriting from TCPServer and I'm inheriting from BaseRequestHandler to do my processing. I'm not calling self.request.close() anywhere in the handler, but somehow the se...

How to communicate between Rhapsody models in different processes/systems?

We are using IBM (formerly Telelogic) Rhapsody for a new project to do model driven development of a complex device. The device consists of several subsystems that are connected by various network interfaces. We'd like to model the entire system in Rhapsody and then generate code separately for the various subsystems. The problem is thi...

simulate socket errors

How to simulate socket errors? (sometimes server or client disconnects because of some socket error and it is impossible to reproduce.) I was looking for a tool to do this, but I can't find one. Does anyone know either of a tool or has a code example on how to do this? (C# or C/C++) ...

How can a WCF service listen the same port as IIS?

I could run a Windows Service hosted WCF service listening http://localhost:80/MyService while IIS was serving pages on http://localhost:80 and both works. But many places in the internet (like this and this) say that only a single process can listen each port simultaneoulsy. Are they wrong? ...

wxWidgets socket events in a DLL

I'm working on a project that is using wxWidgets sockets in a DLL and I'm getting odd behaviour. I'll go through the problem from the top and drill down. I apologize if I've provided too much (or too little) information; I've tried to prune down the excess. First, the odd behaviour: The server is created, and my client connects to it. ...

TCPIP server single connection

i need some tips! i am using c# sockets Asynchronous mode. i need to serve only one connection in my application from a server point of view. once one is connected then i would like to refuse any more connection requests. also the server only serves to connect to a single client. when the communication is done the server has to be res...

Simple UDP Socket Tutorial Needed

I have been searching and reading all day, and have not found a UDP sockets programming tutorial suitable for a newbie. I know UDPClient programming, but, because of the inability of UDPClient to receive a message without blocking AND without having problems with cross-thread commands, I have turned to sockets. I don't even truly know if...

if i have already connected to the server. then how i show exception saying it is already connected

how to add in exception showing the input has to be enter, if the user click on connect without entering any input? i would like the have a message box show if the user click on the connect button without entering the name, ip and port. [SOLVED] using System; using System.Collections.Generic; using System.ComponentModel; using System....

How to send data from c# client to java server via socket?

Hi, I have a socket sever is written by java, it always listens on specific port. I wrote a client in Java and it could connect to the server but when I created a client in C#, I could not connect to Server. I just want to send a short value to start a java server. I guess the problem come from the endianess (little-endian, big-endi...

What more socket APIs are available? What are the differences between each of these Socket API?

Everyone referred to it as Socket Programming or Network Programming in C and we started using it by using by including sys/socket.h & netinet/in.h. We thought it was 100% true. But question raised in my mind when I saw this book Internetworking With TCP/IP Volume III: Client-Server Programming and Applications, which was available in 4...

C# Asynchronous Socket Comms Blocking

I have a socket wrapper class that sends and recieves messages with a server (specifically commands, responses, and notifications). I also have a consuming class that serializes the commands into text to send through the wrapper. My problem is that when a command is sent, I need to wait until I get a message back with a particular head...

Are there some up-to-date tutorials on Perl network programming?

Are there links, materials, or books about network programming with Perl that are relevant to 2010? I saw some books on programming the network with Perl are very old (about a decade) and the tutorials on the internet are also old and using old modules. Could someone provide a good reference about programming sockets and network layer/...

Java Socket Server that services clients serially

Is there a way to implement a socket server that services clients serially. Generally the practice is to dispatch connected clients to a new thread that services requests and response however amounting to one thread per client on the server side. I don't want to do this because I later want to port this app to Java ME that may have a ...

any suggestion on clustered client server comm. approach?

Let's say i'm building a client server software. the main server connects to agents on different servers. the agents is a search client and each will return quite huge array of 64bit integers and finally the main server (parent) will sort it to produce finaly result. Which is better/faster approach, using a socket to get all the data...

Java Sockets & the Internet

Hi, I created a small chat program, that works flawlessly when client & server are run on the same computer (and probably network, too). However, as soon as I try to connect to another computer over the internet, the socket connection simply times out. Is this because of firewalls / routers, etc? And how can I connect a ServerSocket &...

monitor incoming/outgoing http traffic with .net

I want to write a small application that can: 1. monitor URLs requested via a web browser and/or 2. monitor incoming http responses on the local machine I have been doing some Googling, but I am not finding any clear answers. I am thinking maybe System.Net.Sockets.TCPListener and messing around with it, but I am under the impression t...

raw sockets on 64bit machine compilation problems

Hi All. I'm trying to do some raw socket programming. I have some example code that compiles/run just fine on a 32 bit machine but when I try to compile the same code on a 64 bit machine I get this discrepancy between /usr/includes/sys and/usr/includes/linux header files. I would have thought that on a 64 bit machine all the headers are ...

Writing a java.net.SocketImplFactory

The javadoc for SocketImplFactory specifically mentions that "An application, by changing the socket factory that creates the socket implementation, can configure itself to create sockets appropriate to the local firewall." However, in order to connect to the firewall in question, one would need a real socket to do the real connection. ...