networking

UnknownHostException for server java

I am not able to connect to an remote known server through Java code; the exception while connecting is java.net.NoRouteToHostException: No route to host. But strangely, I am able to connect to same server through ssh. Details: Simple Java client when tries to establish connection with Java standalone server, while conneting the except...

HttpWebRequest How to handle (premature) closure of underlying TCP connection?

I have a hard time figuring out if there is a way to handle potential connectivity problems when using .NET's HttpWebRequest class to call a remote server (specifically a REST web service). From my investigations the behaviour of the WebClient class is the same, which is somewhat expected since it appears to only offer a more simple inte...

How does one tell if there is an active network connection on OS X?

I want to provide my user with some meaningful error messages when network requests fail. On Windows I can call InternetGetConnectedState() to see if there is an active network connection. What is the OS X equivalent? Bonus points for example code if it's complex. ...

Fat Java client need two-way communication channel to web server over http/https

I have a situation where I want a Java client to have a two-way data channel with a servlet (I have control over both), so that either can begin data transferring without having to wait for the other to do something first, but to get through the firewalls this needs to be tunnelled in http or https. I have looked around, but I do not ...

Socket Dis-Connects On One End, Firewall?

I have a C# application that has been running fine for several years. It connects via a TCP/IP socket to a machine that sends me stock trade executions. Recently, I've tried to deploy it to some machines in a new data center that is behind a hardware firewall, and I've started to see some weird dis-connects. When a dis-connect happen...

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...

Mono Compatible Networking/Socket Library

Are there any Mono (C#) compatible networking / socket libraries out there? Preferably something that is: Multi Threaded Event Driven Capable of multiple connections Handles client and server pieces Runs on Mono and MS .NET runtimes Very simple Free (And usable in commercial software) It would also be really great if it was: .NET ...

Multiplayer Game Synchronization

I've a server/client arcitecture implemented, where all state changes are sent to the function, validated and broadcasted to all clients connected. This works rather well, but the system does not maintain syncrynization between the client instances of the game as of now. If there happened to be a 5 second lag between the server and a pa...

Socket server ip/port problem

I'm trying to set up a socket server on a ubuntu machine. I've been setting up the same server-script on my own machine where it works perfectly. In my router i forwarded port 10007 to the right machine and bind the ip to my local ip (192.168...:10007). Now i need to set it up on a dedicated server though and that is where the problems ...

TcpListener.AcceptTcpClient and Firewall

I have a TcpListener object that is operating behind a firewall on port 4000. Obviously, in order for outside clients to connect to the TcpListener, port 4000 needs to be opened in the firewall; otherwise, no outside connection request would get through. My question has to do with what happens when I accept the connection request like ...

How to block a website programatically using DotNet

Hi I am developing a windows application to block the websites from a computer using DotNet windows programming.I found some results to block an url but not for a website. That is I have to block complete website not a single url. So can some one help me to solve this problem Thanking You Chaithanya ...

Blackberry App, display images from Web

I'm using the Blackberry JDE (9000 simulator), and am wondering if I can display an image from the web. Currently, I'm seeing tutorials that use Bitmap.getBitmapResource to display images that are local to the blackberry application, but looking at the API, I'm not seeing any support for giving a web URL. Are there other Blackberry ima...

talking between python tcp server and a c++ client

I am having an issue trying to communicate between a python TCP server and a c++ TCP client. After the first call, which works fine, the subsequent calls cause issues. As far as WinSock is concerned, the send() function worked properly, it returns the proper length and WSAGetLastError() does not return anything of significance. Howeve...

Actionscript 3.0 network programming with C#

Hey guys, I was looking into network programming with AS3 and I noticed that all the examples were using Java to code a server. I tried using C# to make one but it wasn't working as expected. I was wondering, does anyone have a really simple example of AS3 networking using a C# server? Thanks. ...

Framework for Scalable Multithreaded Client/Server Network Application

Although the java.net.Socket and java.net.ServetSocket give me powerful networking capabilities I wouldn't want to go through the nitty gritties of creating and managing my own sockets and threads. What open source Java Frameworks are available to create/deploy a Highly Scalable Multithreaded Client/Server Network Application? ...

Have been cursing over data packets for 36 hours now, please help!!

Ok Here is the problem. I am trying to send through a structure or anything through the apple bluetooth send network packet code. The code to send is below -(void)sendMessagePacket:(GKSession *)session packetID:(int)packetID withData:(void *)data ofLength:(int)length reliable:(BOOL)howtosend { static unsigned char networkPacket[maxPack...

performance tool

Hi, I basically have a unix process running and it is doing some heavy processing as well as outputting data over the network. I was wondering what system calls are used to interact with the networking layer. I would like to measure the performance metrics of this process: CPU usage, networking usage. I am not sure if this process is b...

How to set different timeouts for each socket that select() monitors?

I am currently using the BSD sockets API. I would like to use the select() function to monitor (a) the listener socket which waits for new connections using accept(), and (b) all the client sockets created via accept() or connect(). I want the listener socket to not have any timeout, and I want each client socket to have a timeout of 120...

Acquire an IP address from dhcp server for my C# app - Like Virtual Machines

Hi, I'm developing an application of multiple socket connections (a TCP alarm watcher). Currently, in order to mock the alarms, i made small applications running on a VM Machine (that is, because the Vm have a different IP) that simulate the alarm endpoints. What I want to do is to mock the alarms in the same machine I'm running my "ser...