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...
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...
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
...
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 ((...
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 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...
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...
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...
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:/...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...