network-programming

Selector.close throwing a java.util.ConcurrentModificationException on AIX platforms

Hi, I am using java nio selector, and seem to hit the following issue randomly but consistantly in my application while calling the selector.close. The selector object is being accessed by a single thread in my application. The same application works fine on Solaris, Linux and Windows. I feel that this is an issue is with the AIX...

server socket hosting

To test a client/server networking application using socket programming, Is there a free hosting company that would allow me to open Server sockets and listen on a port? ...

Reading from TCPSocket is slow in Ruby / Rails

I have this simple piece of code that writes to a socket, then reads the response from the server. The server is very fast (responds within 5ms every time). However, while writing to the socket is quick -- reading the response from the socket is always MUCH slower. Any clues? module UriTester module UriInfo class << self ...

Strange behaviour of networkstream.read() in C#

When i write to a network stream two seperate byte array, i sometimes dont get the first byte array. Why is that? For eg This fails, the header is not received, sometimes by Read() on other side byte[] header = msg.getByteHeader(); byte[] data = msg.getByteData(); clientStream.Write(header, 0,...

Domain name interpretation utility for java

I find myself with a need for a java utility for taking a fully-qualified hostname, and producing the domain name from that. In the simple case, that means turning host.company.com into company.com, but this gets rapidly more complicated with host.subdomain.company.com, for example, or host.company.co.uk, where the meaning of "domain n...

Asynchronous network IO using r: Any existing packages

Are there any R-project packages that facilitate asynchronous network IO? I'm think here along the lines of Ruby's Eventmachine or Python's Twisted. If there are several such packages/libraries which is the best in terms of: - performance - features ...

Internet Board Games

Hello I'm looking to create a web-page where users can play Gomoku live with eachother, kind of like instantchess.com, or yahoo's online pool. I would like to be able to.. 1) Have the players to chat with each other while they play. 2) Have registered users where a ranking can be kept track of. 3) Users can create 'rooms' where another ...

How to handle buffering data read from the network?

When reading data over the network, you specify a buffer to receive the data into: byte[] b = new byte[4096]; socket.Receive(b); Now my first thought is of course to reuse the receive buffer by declaring it as a member variable of the class. My next issue is that I have not received all of the data that I am expecting, so I need to bu...

What is the purpose of the AI_V4MAPPED flag in getaddrinfo?

The getaddrinfo call has many interesting flags. I'm wondering what the purpose of the AI_V4MAPPED flag is. On no system do I seem to be able to get getaddrinfo to produce ::ffff:n.n.n.n form addresses as I would expect when I set this flag. Am I expecting the wrong thing? Am I seeing bugs? In particlar, if I ask for AF_INET6 family...

Looking for a framework for logging arbitrary objects in heavily distributed and parallelized system in .NET

(Note: I have seen several questions regarding .NET logging frameworks, but haven't seen any which resembles our requirements. So please don't close this one as a duplicate.) We will need a logging framework for a highly distributed and parallel .NET application with the following features: It must be thread-safe, as log messages wi...

Windows Process and Ip Address that it's connected to.

I'm trying to get the ipaddress that a process is connected to in c#. Is there an easy way to do this? ...

how to export data to computer(PC) using wifi or http connection?

Hi, I have made Iphone applicatio. In my application whatever data i have recorded; all that data i want to export to the Computer using the application. Is there any way available to sent data to computer using wifi using developed application? Can we use Bluetooth or Http connection to send application from device to the PC? if we c...

Unit Testing Network Connection

I am doing a unit testing and I need to find a way to simulate a disconnection during DB transactions without actually or physically removing the network cable..The process must be automated since this is just part of a bigger scale of unit testing. I need to check if roll backs are handled accordingly ...

Retrieving the local IP address based on HttpConnection using Java

Is there any way to determine the IP address of the socket used to create the HTTP connection when the class used to create the connection was HttpUrlConnection? ...

Heartbeat Protocols/Algorithms or best practices

Recently I've added some load-balancing capabilities to a piece of software that I wrote. It is a networked application that does some data crunching based on input coming from a SQL database. Since the crunching can be pretty intensive I've added the capability to have multiple instances of this application running on different servers ...

how to differentiate if client is using TCP or UDP from server side

I am writing simple client-server program. Client send some messages to server using UDP or TCP. Server must be able to support both UDP and TCP. If client, sends message using UDP, sequence of method calls in client is socket(),bind(),sendto(),recvfrom(),close() and that in server is socket(),bind(),sendto(),recvfrom(),close(). If it...

client-server program, problem sending message from client to server and viceversa using TCP

Hi, I have a small program that sends and receives data from server and client and vice-versa. Everything works fine, but I can't see received messages in both sides and it is always 0 bytes. It doesn't give any compile error but doesnt work the way I wanted to. Can you please have a look at this, where I am doing wrong ? Thanks // clie...

Advantages of knowing for a client, how big the package sended by the server is

I'm really new at network-programming, so I hope this isn't a complete Newbie-question. I read a tutorial at the Qt-Homepage how to build a little server, and I found this: QByteArray block; QDataStream out(&block, QIODevice::WriteOnly); out << (quint16)0; out << "..."; // just some text out.device()->seek(0); out << (quint16)(block.s...

How to analyze/intercept packets before they are sent/received by the OS?

I have always wondered how software firewalls work under the covers, and would like to be able to write my own custom tools to analyze or intercept packets before they are sent or received by the OS. I'm fairly acquainted with core networking principles; I just have no clue where to start if I want to write software that fits inside the ...

Multiple threads for multiple ports?

Hello, To start off, I don't know very much about network programming... So given that, I have a program (process) which needs to listen on 3 ports... Two are TCP and the other UDP. The two TCP ports are going to be receiving large amounts of data every so often (could be as little as every 5 minutes or as often as every 20 seconds...