networking

Interrupting epoll_wait with a non-IO event, no signals

Current scenario is epoll_wait over a couple of fds and a queue of possible incoming messages, I'd like the loop below epoll_wait to be executed on IO event or on new message. Ways I know: Use a time msec timeout and check the queue first thing in the loop Use the self-pipe trick from the queue code when messages become available Int...

Received UDP packet length

How to get the length of received UDP packet? Using wireshark I could see the correct length of datagram. How can I print this value in my simple udp server program? I am receiving binary data (Non printable ascii characters as a data) So I can not use strlen(buf) which throws incorrect length. if (ret=recvfrom(s, buf, BUFLEN, 0, ...

MySQL Persistent Connections

I have 10 application servers and 1 mysql database. I would like to do connection pooling for mysql, but simply enabling mysql_pconnect() will not work since it'll cause some servers to have more connections than others. What's the best solution for this scenario..? ...

Research topic on distributed systems

Hello there. I have a research project on distributed systems, I asked the Prof. if i can work on MapReduce and he is giving me hard time that MapReduce is very broad and asked me to pick a specific problem about either distributed systems frameworks like MapReduce or something else that has networking and distributed computing in it. ...

Differentiating Between Two Computers On The Same Intranet

I am trying to create a Socket "Hello World" program. I would ideally like to create two programs who can exchange simple text, peer-to-peer. I can create a webservice that the peers can post their IP Address to. One peer can then select another to pair up with. If one of the peers is my desktop computer, and the other is my laptop, ...

How to rapidly read data coming through a 10GbE NIC?

I have two debian boxes connected by a CX4 cable going between two 10 GbE cards. One is going to be generating data very quickly (between 4Gbits/s and 16Gbits/s), and the other needs to be able to grab all of that and store it in RAM for later parsing. I'm new to this kind of low-level coding, and would happily accept any ideas about w...

Acessing netstat-like data with .NET

Hi there, I'd like to know if there is any way to access info like number of discarded packets from within .NET framework. I am aware of Win32_PerRawData and Ip Helper API. Thanks in advance ...

http header in a packets?

how to retrieve the http header in a packet in c++? any sample code or tutorials can be a big help!.. thanx!.. note: winpcap was used for the packet sniffing and these packets are already filterd to be only tcp and http/s protocols..the only problem is how to decode the packet's http header.. ...

how to reassemble tcp segment?

im now developing a project using winpcap..as i have known packets being sniffed are usually fragmented packets. how to reassemble this TCP segements?..any ideas, suggestion or tutorials available?.. this i assume to be the only way i can view the HTTP header... thanks!.. ...

Find closest IP

I know how to scan subnets in c++...I also know how to find geo location (altough it's not 100%)...But does anyone have an idea how can i find the closest ip addresses to mine ? Ex one neighbor is 100 meters from me and another one is 50 and if they are both connected to the internet, i should get the ip of the second which is 50 meter...

Get notified about network interface change on Linux

I need a way to notify my user space app when a network interface is enabled or disabled. I'm hoping to do this without resorting to polling. Does the kernel offer some sort of hook for triggering callback functions when network-related events occur? ...

How to implement long lived network connection in dotnet

The idea is to have a windows service, that clients can connect to (tcp, wcf, remoting), and when the data changes in the windows service, send the changes to the clients. An example of this would be a stock pricing server, and when the price changes for instruments, send the changes to the client. Wcf does have streaming, but is that ...

How to upload all .html files to a remote server using FTP and preserving file structure?

I have edited about 100 html files locally, and now I want to push them to my live server, which I can only access via ftp. The HTML files are in many different directories, but hte directory structure on the remote machine is the same as on the local machine. How can I recursively descend from my top-level directory ftp-ing all of the...

Obtain MAC Address of Devices in range of router

Is it possible for a router to obtain the MAC address of nearby devices that have not connected to it? I want to write an app that notifies me somehow (email or something) when a specific MAC address comes within range of a router that I have (the app is much more specific than that so I cannot use prebuilt tools but if they are open sou...

How to troubleshoot networking problems

I am seeing a problem with few IP Cameras as I am loosing connections with the cameras from the server. The connection loss happens after running for few months. I don't loose the connection with all the cameras. Please provide pointers on how to trouble shoot this problem. Thanks, Sunil ...

Which adapter did I just receive this UDP packet on?

I'm trying to write a BOOTP server in c#. I'm receiving and parsing the BOOTP packet from the client and I need to reply with my server IP address. The problem is: The computer can have multiple network adapters The client doesn't yet have an IP address Is there any way to find out what adapter the UDP packet was received on? ...

Help with windows TCP Port communication

I'm new to understanding how interprocess communication works. I"m working with two applications on my localmachine, a Source Application and a Server Application. The Source application broadcasts files through a configured port on my pc. The Server application listens for those files and exposes them to the internet for users to stream...

Receiving packets for different MAC address.

Hello, is it possible to capture some packets in promiscuous mode (e.g. using winpcap) and than force OS (applications) to receive them as they were sent for our MAC? My observation is following. We can: capture all network traffic using promiscuous mode (winpcap) filter/modify the packets using firewall-hook/filter-hook send packe...

Easiest way to find free IPAddress in current subnet?

What is the easiest way to find the next unused IP address on a local adaptors subnet? IPAddress GetNextFreeIP(NetworkInterface intface) { ...? } Update I've written a BOOTP/TFTP server that could be used in many different scenarios (cross-over cable, small private network, large corporate network). I have to give the small embedd...

Can't receive multicasts on Windows Server 2008

I have the following code which works fine on my Windows 2003 server: static void Main(string[] args) { UdpClient sock = new UdpClient(5353); IPAddress multicastIP = IPAddress.Parse("224.0.0.251"); IPEndPoint multicastEndpoint = new IPEndPoint(multicastIP, 5353); sock.JoinMultica...