network-programming

Communication over a Bluetooth PAN Ad-hoc network on Windows Mobile

I have two devices that are connected via a Bluetooth Ad-hoc Personal Area Network. What can I do to actually have my app communicate over this network? I am kind of at a loss for the next step. The end goal is to take a in memory class and transfer from one device to the other. I would love an example in C#. (I am using Compact Fra...

Sending large chunks of data over Boost TCP?

Hello, I have to send mesh data via TCP from one computer to another... These meshes can be rather large. I'm having a tough time thinking about what the best way to send them over TCP will be as I don't know much about network programming. Here is my basic class structure that I need to fit into buffers to be sent via TCP: class Pr...

Is there a method to procedurally detecting if network router supports DHCP using C/C++?

There is a scenario where an application tells a device on a network to get their IP address from the network router's DHCP server. If a DHCP server is not available, the device's behavior becomes erratic. Is there a method to procedurally detect if the network router supports DHCP? Or, is this something the device needs to do when at...

Using TCP for real-time commands: Nagle arithmetic causes huge delays, what should I do?

I'm writing a socket server and flash game client. The game requires real-time commands such as movement and turning. It is important for these commands to be sent by the server to the client as soon as possible because the other clients will otherwise desynchronise a lot with the moving/turning client. This is an example of the problem...

Twisted: source IP address for outbound connections

I'm in the process of implementing a service -- written in Python with the Twisted framework, running on Debian GNU/Linux -- that checks the availability of SIP servers. For this I use the OPTIONS method (a SIP protocol feature), as this seems to be a commonplace practice. In order to construct correct and RFC compliant headers, I need...

Loopback adapter name in Linux

Is it safe to assume that the loopback network adapter on a Linux system will always be called 'lo' - is this just a naming convention that may not be adhered to, or must it always be the case? ...

Designing a simple network packet

I'm learning socket programming (in python) and I was wondering what the best/typical way of encapsulating data is? My packets will be used to issue run, stop, configure, etc. commands on the receiving side. Is it helpful to use JSON or just straight text? ...

Real-time game networking libraries for games in Java and Objective-C

I'm looking to build real-time games built using a dedicated Java server and iphone clients as well as Java desktop clients. What available high-performance network transport libraries that could be used for real-time multiplayer game development, exist for Java and iphone (specifically reliable UDP)? The general advice for most real-ti...

Netty vs Apache MINA

Pros/Cons of using either ? They both provide roughly the same functionality. Which should I choose to develop my high performance TCP server ? ...

Packet Sniffing using Raw Sockets in Linux in C

I need to write packet sniffer in Linux that detect http packet that send and save the url that request . I see code in security-freak and run related code . This code run and only sniff received packet but I need send packet to sniff . In this code how to detect sent packet ? I can't use any library like libcap or ... (forbidden) the...

IP Filtering/Matching by host mask with PHP & MySQL

Hey there, I'm wanting to do something similar to this: http://stackoverflow.com/questions/594112/matching-an-ip-to-a-cidr-mask-in-php5 Except, I want to store a list of disallowed IP/Masks in a MySQL table and check for a match. Just like the example in the link, something like '10.2.0.0/16' would be a row in the table and then I wan...

Running a simple TCP server with poll(), how do I trigger events "artificially"?

I have a fairly basic TCP server keeping track of a couple connections and recv'ing data when it's available. However, I'd like to artificially trigger an event from within the program itself, so I can send my TCP server data as if it came from sock1 or sock2, but in reality came from somewhere else. Is this possible, or at all clear? s...

Python, Pygame, Pyro: How to send a surface over a network?

I am working on a project in python using pygame and pyro. I can send data, functions, classes, and the like easily. However, I cannot send a surface across the wire without it dying on me in transit. The server makes a surface in the def __init__ of the class being accessed across the wire: self.screen = pygame.display.set_mode(SCREEN...

Lots of ports with little data, or one ports with lots of data?

I've been checking out using a system called ROS (http://www.ros.org) for some work. There are lots of different types of data that get sent between network nodes in ROS. You define a struct of data that you want to send in a message, and ROS will handle opening a specific port between the two nodes that will only send that struct of da...

How to create a Boost.Asio socket from a native socket?

I am merely trying to create a boost ip::tcp::socket from an existing native socket. In the assign function, the first parameter must be a "protocol_type" and the second must be a "native_type", but it never explains what these are or gives an example of its use. I'm guessing the second should be the socket descriptor, but I'd really ap...

How to get duration of connection in network connection with wmi or others

Hi all, I'm currently working with mfc to make user application that shows connection status. I use WMI to get all of the queries that i need like status, network name, speed, signal strength except duration of connection. I tried to google how to get the duration of connection using wmi but i only find TimeOfLastReset query in Win32_...

Best practices of high-performance network applications

While testing out a UDP multicast server that I've written on Windows 7 Ultimate x64, I came across a most curious thing. Playing music with foobar2000 in the background significantly improved the server's transmission rate yet also incurred minor packet loss. Turning the music off immediately dropped the transmission rate to below accep...

socket "read" hanging if the MacBook sleeps more than 10 minutes

I am writing an app, where a socket is connecting to a host and downloading a file. The application runs in Mac. Now, while the app is downloading, if I put the MacBook in sleep mode for more than 10 minutes, 60% of the time the app hangs when the computer wakes up. The stack trace shows that, it has hanged in the "read" call. I am abl...

How to implement server-sided applications that can process user's inputs?

There are some web-based services such as converting .flv files into .mp3 files, .doc files into .pdf files, etc. These are the servers that take files from the user and apply respected applications (such as conversion). After that, the converted file may be available to the requested user. I understand a little bit about writing a text...

Confusion in htons- little endian/ big endian

When I send a integer variable from one process to other through socket, and then printing the value at received end, the value is still the same without using ntohl/htonl, then where do I need to use these functions other than initializing socket structures. I understand litte/big endian. But why do we need to convert port and IP nos to...