network-programming

Detect If IPv6 is Enabled on Windows Machines

Hi Folks, I am writing a powershell script that will act as a build compliance test for our servers. One of the things I need to do is detect if IPv6 networking has been disabled. WMI indicates that this information can be found in the IPAddress Property of Win32_NetworkAdapterConfiguration but can be both IPv6 or IPv4. This does not g...

Non-Blocking UDP-Client Receive Thread-Safe Call

I have been looking for a solution to this problem for ages. I have tried many things, including BeginReceive(), but all to no avail. There must be a way to do this, make a UDP-Client receive call that is non blocking AND thread safe. I am trying to receive a message and write it to a Rich Text Box. using System; using System.Collection...

What is the maximum packet size a python socket can handle?

Hey hi guys, i am new to network programming in python. I wanted to know that what is the maximum size packet we can transmit or receive on python socket? and how to find out it? ...

What is the framework/function used in Cocoa for detecting machines

I'm trying to get a listing of machines in my local domain, specifically ones running a administrative web service (_asip-webadmin). I've been fooling with NSNetService but it would seem that it's only good for Bonjour listings (as I can trap them just fine). I've tried something along the lines of: [mySearch searchForServicesOfType:@"_...

sending file by C++

I want to send a file in C++ over network (for a chat program) what should I do? ...

How do online port checkers work?

For example http://www.utorrent.com/testport?port=12345 How does this work? Can the server side script attempt to open a socket? ...

Difficulties displaying the text in simple client/server chat program (current input gets displayed) - C

I am writing a chat program for my networking class and I have all the networking setup perfectly. My problem is if a client is currently writing a message and he receives a message from a different client then his current input gets displayed with the received message. For example if a client is writing a message "Hi there how are yo...

Capturing network status change event

I am trying to get events when the internet connection is reestablished after it is lost. It is for a data transfer software that I am developing. If I lose the network during data transfer, I would like to be notified when it is back and continue the transfer automatically. I can of course create a separate thread and check the network...

Creating an IPEndPoint from a hostname

I am using a third-party dll that requires an “IPEndPoint”. As the user can enter either an IP Address or a Host name, I need to convert a Host name to an IP address before I can create an IPEndPoint. Is there any functions to do this in .net or am I going to have to write my own DNS lookup code ? ...

Network discovery programmatically

Is there a specific protocol used for network discovery? I'm looking to code this into an existing java project. Currently I'm using a port scanner to handle the case, but I'm looking to swap that out for something that can give me a little more info. If possible I'd like to scan to discover machine and pull the Ip addr, host name, MAC...

Extract IP from connection that listen and accept in socket programming in Linux in c

From this code I open a socket (server) and listen for incoming request when someone request accept this and save file descriptor (FD) in newsockfd how to extract IP for requester ? int sockfd, newsockfd, portno, clilen; portno = 8090; clilen = 0; pthread_t serverIn; struct sockaddr_in serv_addr, cli_addr; sockfd = socket(AF_INET, SOC...

What is easiest way to send structured data via tcp using java?

I have to connect to a existing C system, and the tcp packet looks like typedef struct exampleDataPacket{ int messageType; float dataValue; char dataDesc[100]; } So to send this kind of data using java, I can't find anything in my books. What would be the best way to send/receive this kind of data? Thanks, CP ...

Inconsistent packet delivery by NIC, NIC performance measurement

One of our customers experiences problem with our streaming application (win32). It seems like UDP (RTP) packets that should be sent by the application with some constant interval (say 20 ms) are actually sent with a greatly variable deltas (say 15ms - 25ms - 10ms - 30 ms). This is the only customer that experiences the problem so netwo...

Convert Ping application to multithreaded version to increase speed - C#

I have an application that pings every possible IP on your local subnet in order to compile a list of responsive IP addresses. Currently it pings all 255 one at a time. Is it possible to convert this app to use multiple threads to increase the speed by pinging more than one at a time? I am new to the concept of multiple threads and fi...

What are some tips for buffer usage and tuning in custom TCP services?

I've been researching a number of networking libraries and frameworks lately such as libevent, libev, Facebook Tornado, and Concurrence (Python). One thing I notice in their implementations is the use of application-level per-client read/write buffers (e.g. IOStream in Tornado) -- even HAProxy has such buffers. In addition to these a...

Simple open socket hanging very infrequently

I have a rather simple piece of code that is hanging in java. The hang is VERY infrequently. Maybe on the order of once every 1000 executions. Running it in a loop to a device doesn't seem to reproduce the problem. long timeout = 10000; long endTime = System.currentTimeMillis() + timeout + 5000; Socket pingSocket = null; String host ...

How can I simulate TCP/IP errors?

On a multi-tier application, I need to simulate various TCP/IP errors to test some reconnection code. Does anyone know of any tools (Windows based) I can use for this purpose? Thanks. ...

How to find whether the MORE FRAGMENTS field is set or no ?

Given this header , how do I find if the MORE FRAGMENTS field is set or not.. struct sniff_ip { u_char ip_vhl; /* version << 4 | header length >> 2 */ u_char ip_tos; /* type of service */ u_short ip_len; /* total length */ u_short ip_id; /...

Are there c++ classes or functions to use for asynchronous sockets between Unix and Windows?

Does someone please tell us where to find classes or functions that communicate with asynchronous sockets (TCP and UDP) between programs runing on unix and windows? Thanks for your reply PS; I have already programs that communicate with synchronous sockets. ...

Network programming in Python

What library should I use for network programming? Is sockets the best, or is there a higher level interface, that is standard? I need something that will be pretty cross platform (ie. Linux, Windows, Mac OS X), and it only needs to be able to connect to other Python programs using the same library. ...