network-programming

recv() with errno=107:(transport endpoint connected)

well..I use a typical model of epoll+multithread to handle massive sockets, that is, I have a thread called epollWorkThread that use epoll_wait to handle i/o sockets. While there's an event of EPOLLIN, recv() will do the work and I do use the noblocking mode to allow immediate return. And recv() is indeed in a while(true) loop. Everythin...

High rate data stream and memory deficiency

I have a program that accumulates traffic from network interface in 800 Mb/s. This program is developed by Delphi, also in 32bit platform(Delphi does not support 64bit architecture). I'm writing received date on the memory(RAM) and after a while (unknown and depends on received data), write a block of received data (unknown size and dep...

Parse large XML files over a network

I did some quick searching on the site and couldn't seem to find the answer I was looking for so that being said, what are some best practices for passing large xml files across a network. My thoughts on the matter are to stream chunks across the network in manageable segments, however I am looking for other approaches and best practice...

Easy way to create fragmented IPv4 packets

I'm working on a network stack at the moment, and I'm trying to implement IPv4 fragmentation. Whilst I have an implementation which works in theory, I would like to actually test that it works by throwing actual fragmented packets at it. Is there any software or perhaps an easy way to write code to do this? I'd rather not go and modify ...

Network connection setup in constructor: good or bad?

I'm working on a class that handles interaction with a remote process that may or may not be available; indeed in most cases it won't be. If it's not, an object of that class has no purpose in life and needs to go away. Is it less ugly to: Handle connection setup in the constructor, throwing an exception if the process isn't there. H...

BIND ERROR : Address already in use

I am learning socket programming in c, I wrote this simple program to accept connections on port 5072. i connect to it using telnet. This works fine the first time but when i try to run it again immediately it fails showing BIND : Address already in use, but then again starts to work after a minute or so. What am i doing wromg? #includ...

What kind of SCTP support is there on various Windows versions?

What kind of SCTP support is there on various Windows versions? ...

How do i monitor network traffic on Windows from the command line

How do i monitor network traffic on Windows from the command line; specifically the download/upload speeds and amount of data uploaded/downloaded ? Is there a script /batch for doing that ? ...

Making MultiCast with Scribe

Hi, I need to make a MultiCast with Scribe. The problem is this: We have 4 machines. 1) Is sending the messages 2) Is receiving the messages with category A 3) Is receiving the mesasges with category B 4) MUST receive all the messages (Cat. A & B) I thought this: Make a Scribe configured in Multi mode and inside it add a Buffer store I...

Network programming with C#

I have a project to do which is packet monitoring. I want to capture each packet receive by specified network interface. I want to know what I should start with to do my project .... should I learn socket programming first or what? should I learn how to use winpcap under C# or just do my own function. please advice me from where I shou...

Is POSIX pselect available in Perl?

Is POSIX pselect available in Perl? A CPAN module is fine also. ...

Request Local WebPage

Hey guys, I need to connect to the IP Address "127.0.0.1:4000", the problem is that I can't find a way to do that in C#, WebRequest only supports URIs (to my knowledge), and I couldn't find a socket function to do it either. Any Help with this would be great, Thanks, Max ...

Is this a scaleable named pipe server implementation?

Looking at this example of named pipes using Overlapped I/O from MSDN, I am wondering how scaleable it is? If you spin up a dozen clients and have them hit the server 10x/sec, with each batch of 10 being immediately after the other, before sleeping for a full second, it seems that eventually some of the instances of the client are starve...

Why is writing a closed TCP socket worse than reading one?

When you read a closed TCP socket you get a regular error, i.e. it either returns 0 indicating EOF or -1 and an error code in errno which can be printed with perror. However, when you write a closed TCP socket the OS sends SIGPIPE to your app which will terminate the app if not caught. Why is writing the closed TCP socket worse than re...

In Perl, how can I check for the existence of Socket options without generating warnings?

I'm checking for the existence and default values of various socket options using Perl. #!/usr/bin/perl -w use strict; use Socket; if (defined(SO_BROADCAST)) { print("SO_BROADCAST defined\n"); } if (defined(SO_REUSEPORT)) { print("SO_REUSEPORT defined\n"); } When I run this it outputs: SO_BROADCAST defined Your vendor has ...

how to know which installed devices has internet connection in WINPCAP?

i have known that winpcap library enabled a person to obtain advanced information about installed devices... given all the networking devices found in the computer, how will i know which one of this has an internet connection?! thanks:) ...

Perl: Checking for the Existence of socket options

This is a continuation of my previous question: In Perl, how can I check for the existence of Socket options without generating warnings? If I run the following code I get the result I expect: #!/usr/bin/perl -w use strict; use diagnostics; use Socket qw(:all); my %opts; if ( defined( eval { SO_REUSEPORT } ) ) { $opts{'SO_REUSEP...

How to Create a Virtual Network Adapter in .NET?

I would like to create/add a virtual network adapter to a client operating system at runtime (via code), preferably in C#. Something similar to that of what VirtualBox/VMware/Himachi creates when you install their software. I am guessing this will require some C/C++ shenanigans for the driver integration, but if it is doable with only C#...

SCTP with Multihoming as a Drop In Replacement for TCP

SCTP has native multi-homing support which if I understand it correctly will automatically reroute your packets over a secondary NIC if the primary interface goes down. I duplicated this functionality with TCP by writing a custom routing deamon to modify the routing tables if my primary NIC goes down. I would like to try using SCTP ins...

Select returning 0 on a closed SCTP socket

This is related to the question: SCTP with Multihoming as a Drop In Replacement for TCP I have a simple echo client / concurrent server app that ran perfectly fine using TCP. I could pipe a file to stdin on the client and the client would receive all the data back, call select which would return 1 indicating the socket was readable, t...