networking

listen() without calling bind()

I tried the following: int sockfd = socket(...); listen(sockfd, 10); accept(sockfd, ...); None of the calls failed, and the program just started blocking as if I had called bind(). What will happen in this case? Will it just be impossible to ever receive a connection, since it has no local address or port? Or was it implicitly assigne...

triggering events "over the wire" in .net

I need a way to trigger events on remote processes "over the wire" and pass parameters (xml serialization, whatever). I want to be able to do things like this. foreach(childClient c in clientList) { MyEvent += c.EventHandler; } MyEvent("param"); what technologies are good for this? WCF? This is a small deployment in house softwa...

JAVA - Difficulties with a simple server seeing the clients

Hello, I am trying to make a simple game that goes across a TCP network. The server does something like this to check for connections, in Server.java: try { server = new ServerSocket(port); System.out.println("Server started on port " + port); while (true) { socket = server.accept(); System.out.println(...

Virtual PC 2007 Can't Access Host Using NAT

I can't access my host machine from my guest machine using the computer name (i.e. WINS). I can access it using whatever IP address it happens to have at the time, but I need a consistent way of accessing it (even if I'm not online). I have a Windows Server 2003 guest virtual machine and a Vista host. I'm using Shared Networking (NAT)...

Simple remote process object interaction in C#

I'm sure there has to be an easy way to do this, maybe I'm making more work for myself than I need to. I'm trying to set up cross system communications in a way that I can have bi-directional communication between objects, I imagine it would be something like this. public interface ISharedResource public class SharedResourceHost : ISh...

Network tools for exploring the internet (traceroute, whois)?

I just recently discovered traceroute and whois. As a newbie discovering these tools, I feel like I can potentially learn and explore a lot just from accessing random websites. Can anyone tell me about other useful tools/information I could use to explore the internet? I just found out about nmap and wireshark. Haven't used either yet. ...

How to Disable Windows TCP/IP Stack in VC++ [Programmatically]

Hi I wanted to know How to Disable Windows TCP/IP Stack in VC++ [ Programmatically ]. We are doing some raw socket programming using winpcap. So our application does not need Windows TCP/IP Stack and We Want to uninstall it the moment our application starts. Please help. Thanks in Advance. ...

How to programmatically edit the routing table

I am writing a daemon running on an embedded platform that needs to change the default route of the device according to which interface it is connecting on at a given time. How can I do this programatically? I know I can use system("route del default && route add default gateway blah"); etc but is there a more direct way? UPDATE: I so...

Freeing up a TCP/IP port?

netstat -tulnap shows me what ports are in use. How to free up a port, in Linux? ...

A C daemon that does traffic shaping

Hi there... I'm working on a C daemon that monitors a configuration file (updated using a web interface) and then uses the Linux "tc" (traffic control) command to update the systems traffic shaping configuration. What's a good way to actually invoke the tc program? Should I use the exec family? Is there a library I can use that would b...

How to use pcap_sendqueue_queue() in winpcap library?

Hi, I used pcap_sendPacket() to send raw UDP packet which i crafted manually. i want to increase the performance of my code by reducing the context switches. But i got the sample code about pcap_sendqueue_queue() function it sends variable number of packets in a time.but it reads read from the already dumped .pcap file and .cap fi...

supporting persistent HTTP connections in my proxy server

Hi all, I am implementing a HTTP caching proxy server in C++.I am done with most part of it but i am stuck at a point. What i am doing is creating each thread with a socket to handle each time a request from browser comes. I parse the request, check for its availability in cache and if not found forward it to end www server.In both cases...

Java Network Programming. Question about sockets

I have a server and has 2 clients connecting to it through TCP. These clients continuously send information to the server. This is a proxy server and relays the messages it receives from the client. But it has to do relay the messages alternately. i.e. message from client A, then message from client B and again A then B and so on. This I...

What's the easiest to remember publicly pingable IP address?

For frequent network troubleshooting purposes, do you know a publicly pingable host with an easy to remember IP address (such as 1.2.3.4)? ...

How to create a lot (I mean a lot) of sockets in Linux?

I have tried to create a simple program in different languages (C#, Java, C++, PHP) to connect to a server and all behaved in the same way. So I believe this problem is more of a OS level thing. Basically I want the program to connect to the server with a TCP socket and send 1 byte and then close the socket. This needs to done thousands...

Why am I getting an error when I try to run my socket program in Java?

I'm using jcreatorLE and JDK 1.6 to run my program. I don't know why I get an error when I try to run. Could somebody explain the reason to me? This is the code for the Server: import java.io.*; import java.net.*; class ServidorTCP { // variable to wait for connections private static ServerSocket servidor = null; // Variable...

Raw Ethernet Frames Using Winsock

I am porting a communications library from Linux to Windows. I know what my approach is for the most part. The library uses all raw ethernet level frames for all the communications. The library I am porting from makes use of the PF_PACKET family and the struct sockaddr_ll. After browsing through the MSDN winsock site, I haven't fou...

How to do a UDP multicast across the local network in c#?

I am trying to get some simple UDP communication working on my local network. All i want to do is do a multicast to all machines on the network Here is my sending code public void SendMessage(string message) { var data = Encoding.Default.GetBytes(message); using (var udpClient = new UdpClient(AddressFamily.Inte...

How can you imitate pushing data to a web application?

Obviously, you can't push data to a web application, as HTTP works in a request-response cycle. But what hacks/methods do you know of that can imitate pushing data to a client? ...

Is it possible to measure bandwidth using ping?

Can we find the internet bandwidth from the time it takes to ping a server if yes how is it done ...