network-programming

c++ gethostbyaddr with user input

I am writing c++ code for a telnet client. I am having problems getting the host address from the user input. struct in_addr peers; cin>>peers; peerserver = gethostbyaddr((const char*)peers,4,AF_INET); if (peerserver == NULL) exit(0); I am new to c++, can anyone suggest a better way of getting the host addr with user input. Tha...

Are there applications where the number of network ports is not enough?

In TCP/IP, the port number is specified by a 16-bit field, yielding a total of 65536 port numbers. However, the lower range (don't really know how far it goes) is reserved for the system and cannot be utilized by the application. Assuming that 60,000 port numbers are available, it should be more than plenty for most nework application. H...

putty on windows using AF_UNIX

Hi, I have recently downloaded source code for putty for windows client. It is using AF_UNIX address family. AFAIK AF_UNIX socket family is not present in windows. Then how it is working here ? I am working on porting a *nix project to windows which has AF_UNIX socket family. Thanks Arpit ...

shared memory is not shared between processes

Hi, I am writing a server program where it receives message from client and broadcast message to all previous clients. I need to create a shared memory between processes, but it seems that the shared memory is not working. Here is my code: int shmid2; key_t key2; void* shm2; string name_list; key2=ftok("tmp",'d'); //create if ((...

Java non-blocking socket

What's the best way to implement a non-blocking socket in Java? Or is there such thing? I have a program that communicates with a server through socket but I don't want the socket call to block/cause delay if there is a problem with the data/connection. ...

Is it possible to make real-time network games in JavaScript

Is it possible to make real-time network games using JavaScript? I've seen flash do it, but I'm interested in making a multiplayer browser-based game that doesn't depend on any plugins. I've read that it is impossible to keep Ajax connections open for streaming communication, and it isn't feasible to make several new Ajax connections per...

Linking Error in Sun Studio 10 under Solaris

I wrote a test program like this: #include <sys/socket.h> int main( void ) { int sock = socket(AF_INET, SOCK_DGRAM, 0); return 0; } And tried to compile it: $ /tool/sunstudio/bin/cc test.c Undefined first referenced symbol in file socket test.o l...

check that outgoing network is open on port 443, with vb6

in Visual Basic 6 How can i check that communication to port 443 is opened for network requests? I must NOT use any 3rd party controls / activeX / OCX, so I'm looking for ways to send / receive an https or just make a connection to a server which is serving on 443, using windows (2k/2k3/xp/7/vista) API calls. There is a known server I...

UPnP announce goes out, but device is not discovered.

i am writing code for a UPnP device to announce itself. i have no interest in it being able to discover other UPnP devices on the network. i am sending out the following messages (taken from wireshark) NOTIFY * HTTP/1.1\r\n NT: upnp:rootdevice\r\n USN: uuid:0000-1111-2222-3333::upnp:rootdevice\r\n NTS: ssdp:alive\r\n LOCATION: http:/...

Way to get client download speed

Hi, I have to tell to the user in a web application(using struts) the download speed. What is the best way? For the moment I simply have a .jsp filled with java scripts and I calculate the time it takes to the user to load this .jsp(I make this action 3 times and take the average speed). It worked ok when I had slow connection speed(un...

Need to extract results from google keywords external tool ?

Hi, Need to build a little java tool that gets the keyword suggestions and traffic estimates from the google keywords tool at https://adwords.google.com/select/KeywordToolExternal . The page is rendered in javascript so simple scraping isn't possible. I have tried htmlunit, but it doesn't work (tried diff browserversions .. still no lu...

how to handle multiple iphone client requests using apache mina?

hi friends, i am working on a iphone application,in which iphone application sends a request to the server using socket connection.in server side java code(using apache mina) takes the request and it processes the request and sends the response. now the problem is if multiple iphone users sends request at a time to the server,t...

Network receipt timer to ms resolution

My scenario, I'm collecting network packets and if packets match a network filter I want to record the time difference between consecutive packets, this last part is the part that doesn't work. My problem is that I cant get accurate sub-second measurements no matter what C timer function I use. I've tried: gettimeofday(), clock_gettime...

How to tell *which* member in MIB_IPFORWARDROW structure is invalid?

A call CreateIpForwardEntry returns ERROR_INVALID_PARAMETER. The PSDK documentation describes this error as: The pRoute parameter is NULL, SetIpForwardEntry is unable to read from the memory pointed to by pRoute, or one of the members of the MIB_IPFORWARDROW structure is invalid. I know for certain that pRoute is not NULL a...

Simple auto updater for OpenVPN config files

Hi, We have deployed several OpenVPN servers globally and our 8k+ Windows users have OpenVPN GUI installed. Each server is defined in a config file in the program files directory. As we add new servers to the network (we require almost a dozen globally) we would like a slick solution to auto update the config directory with the new conf...

Remote executing of Action<> or Func<> objects

Hi everyone! I wanted to transfer (and execute) an Action or Func object from a C# client to a C# server application using WCF. Here's my code: [ServiceContract] interface IRemoteExecuteServer { [OperationContract] void Execute(Action action); } class RemoteExecuteServer : IRemoteExecuteServer { public void Execute(Action...

Android can't see devices on ".local" domain

I'm having an annoying issue with Android development. I have a webserver (Tomcat) running on my Macbook which is connected to the local network via wifi. I have my Sprint EVO connected to the same network using wifi. The only way I can connect to the Tomcat instance is by raw IP address. If I use the Macbook name with or without the ".l...

Java : Socket programming example

What is wrong with the following program to fetch time from time server. public class SocketTest { public static void main(String[] args) { Socket s = new Socket(“time-A.timefreq.bldrdoc.gov”, 13); BufferedReader in = new BufferedReader( new InputStreamReader(s.getInputStream())); S...

File Descriptor Sharing between Parent and forked Children

I am a beginner in network programming.. i follow stevens and implementing UDP server with reliability. i have a question. when a child is forked what happens to parent socket fd in child ...? i read that they get inherited that means we have two copies of socket fd in parent and child ?? do we need to close the inherited parent socke...

Please recommend books on capture/parsing network video stream(including mjpeg) in windows

I'm not stuck by this subject, can you recommend a book really good on this? UPDATE Actually I tried using curl to fetch a snapshot out of mjpeg stream,but fails,the programe continues to output,can't stop: curl_easy_setopt(curl, CURLOPT_URL, "network path to mjpeg"); res = curl_easy_perform(curl); printf("%s", res); curl_easy_cleanup...