network-programming

How to build a server that accepts many thousands of persistent network connections?

I am about build a server on linux (I get to pick programming language) that accepts many TCP/IP socket persistent connections from a desktop software. How can this be done cheaply and efficiently? A machine cannot have more than 60000 ports, so if I have to support 600k connections then I will need 10 linux boxes? Since the computatio...

How to implement icmp packet handler using winsock version 1.1?

I am working on an very old application right now. I need to make change in this application to listen for coming icmp request and decide to reply or drop the packet (kind of access control on ICMP). The application is Winsock version 1.1 based. I tried different ways to create a socket and capture icmp packet using the socket. But none ...

Most effective way to connect/retry connecting using C#?

I am creating a little game client that will end up connecting to a server to gather some information on available games to play, how many players are playing, and all kinds of other stuff that you can imagine it ought to do. My difficulties come in finding an effective way in dealing with the connect/retry connect sequence upon first l...

Where can I find documentation for Net::Libnet?

Could someone provide some links to additional documentation or tutorials for the CPAN module Net::Libnet? ...

huffman algorithm needs help in storing char code

I have written program to obtain the code for each char as shown in the program output. enter some text: nslfaslfjasfj text = "nslfaslfjasfj" a:2 f:3 j:2 l:2 n:1 s:3 Huffman Algorithm Below is "CHAR CODE": n code:111 j code:110 f code:10 s code:01 l code:001 a code:000 My next step should be storing the above in structure...

Tcp connections hang on CLOSE_WAIT status.

Client close the socket first, when there is not much data from server, tcp connection shutdown is okay like: FIN --> <-- ACK <-- FIN, ACK ACK --> When the server is busying sending data: FIN --> <-- ACK,PSH RST --> And the server connection comes to CLOSE_WAIT state and hang on there for a long time. What's the problem ...

UDP Problem With Non-Reception

Hello, I am new to Network Programming, and I am having a problem with some code I've been testing as the basis of a LAN chat program. Server Code: public static void Main() { UdpClient publisher = new UdpClient("230.0.0.1", 8899); UdpClient subscriber = new UdpClient("230.0.0.2", 8800); IPAddress addr = IP...

How can I solve an application networking issue?

Hello, I have assisted with an application that has a couple of thousand deployments. This application is a .NET 2 Winforms application. There are a couple of features that require the application to "phone home" to some custom web services that we have written to update product information. For several years this has worked fin...

C# bandwidth monitor excluding local traffic

I am trying to find some example code to build a bandwidth monitor to keep tabs on my daily on/off peek download usage. I have a semi working solution but the data it shows includes all data transferred over my LAN as well as via my ISP. Is there some way to separate out LAN from ISP bound traffic in data totals. Thanks. ...

What's a portable way of converting Byte-Order of strings in C

I am trying to write server that will communicate with any standard client that can make socket connections (e.g. telnet client) It started out as an echo server, which of course did not need to worry about network byte ordering. I am familiar with ntohs, ntohl, htons, htonl functions. These would be great by themselves if I were trans...

BSD socket compatible wrapper around winsock?

I'm attempting to port a Linux application to Windows. The application isn't too complex, using all fairly standard code, with few external dependencies. The main dependencies are libelf (which compiles fine under mingw), pthreads (there appears to be a win32 version available), and sockets. The main problem is with sockets...Windows pro...

Keeping sync in multiplayer RTS game that uses floating point arithmetic

I'm writing a 2D space RTS game in C#. Single player works. Now I want to add some multiplayer functionality. I googled for it and it seems there is only one way to have thousands of units continuously moving without a powerful net connection: send only the commands through the network while running the same simulation at every player. ...

How to send pcap file packets on NIC?

I have some network traffic captured pcap file and want to send its packets on NIC; is it possible? Is there any application to do this? ...

Scripting languages that support fibers/coroutines?

I'd like to start a new network server project in a language that supports concurrency through fibers aka coroutines aka user-mode threads. Determining what exactly are my options has been exceedingly difficult as the term "coroutine" seems to be used quite loosely to mean a variety of things, and "fiber" is used almost exclusively in r...

What is a good way to connect multiple clients to the server?

Hi, As there are serveral ways of connecting multiclients to the server such as: fork, select, threads, etc. I would be glad if you could describe which is better to connect multiple clients to the server? Thanks for you time and reply? ...

process termination

Hello, I have 2 processes and they send UDP messeges. They don't read the messages immeditely and sometimes when they read the messages they can read a bulk of them. I saw that when one of the processes is down the other one is still getting those messages. How come ? it is down. Thanks ...

Traceroute in Objective-C

Does anyone know of a code sample in objective-c for traceroute? NOTE- I am looking for a code implementation of traceroute/tcptraceroute, NOT a utility. ...

boost::asio cleanly disconnecting

Sometimes boost::asio seems to disconnect before I want it to, i.e. before the server properly handles the disconnect. I'm not sure how this is possible because the client seems to think its fully sent the message, yet when the server emits the error its not even read the message header... During testing this only happens maybe 1 in 5 ti...

List the IP Address of all computers connected to a single LAN

I am writing a program where you connect, for various reasons, to other computers in a LAN. However, rather than having to input the IP address for multiple computers (a pain in the butt), I was wondering if there is a way to list the IP addresses of all the computers in a LAN. I have researched all day, and as of yet have found nothing ...

Implementing all portscanning techniques in C# / Creating raw low level packets in C#

I am trying to write a port scanner in C#. I did some research on port scanning methods. If you are interested, these are the links I found useful: http://www.cs.wright.edu/~pmateti/InternetSecurity/Lectures/Probing/index.html ^PPT Presentation^ http://www.auditmypc.com/freescan/readingroom/port_scanning.asp (old) NMAP ...