A friend of mine came to me with a problem: when using the NetworkStream class on the server end of the connection, if the client disconnects, NetworkStream fails to detect it.
Stripped ... |
I just want to write DNS client program using C sockets that
takes three arguments: a query name (e.g., host name or domain name) and a query type (A, or NS, or ... |
Suppose, I have a connected socket after writing this code..
if ((sd = accept(socket_d, (struct sockaddr *)&client_addr, &alen)) < 0)
{
perror("accept failed\n");
exit(1);
}
How can I know ... |
Any ideas why when the server writes a socket while the client is waiting on select, select never finishes?
I am using c to communicate between sockets. My client connects to my ... |
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
void error(const char *msg) {
perror(msg);
exit(0);
}
int main(int argc, char *argv[]) {
int ...
|
I am using select() statement that handles multiple client connections using Unix C sockets. I would like to disconnect idle clients - if I don't get any messages from clients after ... |
The following code is a test program wriiten to understand the behaviour of select() call in a TCP client program.
What I observe is that the select is not blocking, instead the ...
|
|
I have a FCGI application written in C. We have cases where a client closes an active connection--i.e. leaves the page during page load--which we'd like to detect within the ... |
Till yday my code was running fine, but today I am getting client.c:61:25: error: dereferencing pointer to incomplete type
client.c:63:16: error: dereferencing pointer to incomplete type
The lines have been written below again. ... |
I have a Server X and 2 clients A and B behind the same NAT. A and B need to form 10 TCP connections each to X on the same outbound ... |
I am beginning in C, I made a server in delphi and one client in C with some examples that I found in net... I obtained to make the two if to communicate, however I am with some problems in client... one of them is the BUFFER_SIZE that I have that to define a fixed value... and has commands that they ... |
Socket Help - Multiple Clients Hey everyone, This is my first post on the forum, and I need some help. I am working on a basic client/server style program. Basically the server allows for 3 clients to connect at the same time, and it takes in bid requests and the server needs to keep track of a global bidding value that ... |
Code: #include "unp.h" #define MAXN 16384 /* max #bytes requested */ int main(int argc, char **argv) { int j, fd; pid_t pid; ssize_t n; char request[MAXLINE], reply[MAXN]; if (argc != 2) err_quit("usage: client "); nbytes = MAXN; snprintf(request, sizeof(request), "%d\n", nbytes); if ( (pid = Fork()) == 0) { /* child */ for (j = 0; j < ... |
Hello! This is currently my biggest problem with the chatserver. I need to find out if a client is still connected so I can free up the slot and close the connection when a client leaves. Every connected client goes into a loop, constantly writing new stuff to the socket (the browser) which is the chat stream. Unfortunatly the "write" function ... |
Hello There, I am trying to change a simple client code that will retrieve the web pages from any web site using TCP sockets. It fails in the connect function. When I made the code run on my m/c (with a server), it worked fine but it doesnt create connection to other web sites like google and all. I have a ... |
Hi all, I am trying to connect to a server app I've done, but the client acts wierd. It doesn't connect and WSAGetLastError() doesnt return anything :S. Have a look at my code plz. Code: //Ett fildelnings server program som anvnder sig av WinSock2 och TC protokollet #include #include #include #include using namespace std; int main(){ //Ladda ... |
I am trying to create a simple client socket application in Unix envmt #include #include #include #include int main (int argc, char *argv[]) { int sd; sd = socket(AF_INET, SOCK_STREAM, 0); } At compile time error comes on line where socket function is invoked saying "Undefined Symbol" I complie using gcc compiler |
/* * File: Inside_Client.c * Author: Ghaith Hachem and Adel Youssef * * Created on March 17, 2008, 6:12 AM */ #define EXIT_SUCCESS 0 #define PORT 1234 #define IP "192.168.0.1" #include #include #include #include #include #include #include /* * */ //Variable Definitions //Hostname will be used later with gethostbyname(), i kept an example below ... |
Why is that you can't use third party libraries? You're going to have to roll more than just your own socket abstraction for different OSes, you'll also need to take care of threading, and you won't be able to fork on windows... This just sounds like a bad situation to me. If this isn't some wacky school project, boost is basically ... |