socket programmin


 
Thread Tools Search this Thread
Special Forums IP Networking socket programmin
# 1  
Old 01-23-2006
PHP socket programmin

I was trying to write proxy code but i here is a problem

typedef struct req_msg
{
char *host;//hostname
char *filename;//filename
char *modified;//date
char *data;
char *request;
}req_msg;

while(take_responce(req,request)!=0)
// take_responce gets responce from http server
// req is req_msg
//data from the server is received in req->data
{
totaldata=strlen(req->data);
if(send(sock,req->data,totaldata,0))
//this is proxy's client socket
//data received from the http server is forwarded to client

{
Die("Server failed to send the data");
}
//buffer is made clean every time afte its use
free(req->data);
}




after running the code is failed after saying this
Server failed to send the data: Success


SoS Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

gdbm with c programmin Books & Tutorial.

Hello, Could you please tell me if there are any books/tutorial on gdbm programming with C for beginners. So far, I've found few tutorials and one of those: http://www.network-theory.co.uk/docs/gccintro/gccintro_22.html is easy to understand but very short in treatment as it dealt with ... (6 Replies)
Discussion started by: vectrum
6 Replies

2. IP Networking

Clarification - Setting socket options at the same time when socket is listening

I need clarification on whether it is okay to set socket options on a listening socket simultaneously when it is being used in an accept() call? Following is the scenario:- -- Task 1 - is executing in a loop - polling a listen socket, lets call it 'fd', (whose file descriptor is global)... (2 Replies)
Discussion started by: jake24
2 Replies

3. Programming

Error with socket operation on non-socket

Dear Experts, i am compiling my code in suse 4.1 which is compiling fine, but at runtime it is showing me for socket programming error no 88 as i searched in errno.h it is telling me socket operation on non socket, what is the meaning of this , how to deal with this error , please... (1 Reply)
Discussion started by: vin_pll
1 Replies

4. Programming

socket function to read a webpage (socket.h)

Why does this socket function only read the first 1440 chars of the stream. Why not the whole stream ? I checked it with gdm and valgrind and everything seems correct... #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include... (3 Replies)
Discussion started by: cyler
3 Replies

5. Programming

which socket should socket option on be set

Hi all, On the server side, one socket is used for listening, the others are used for communicating with the client. My question is: if i want to set option for socket, which socket should be set on? If either can be set, what's the different? Again, what's the different if set option... (1 Reply)
Discussion started by: blademan100
1 Replies

6. UNIX for Advanced & Expert Users

connect problem for sctp socket (ipv6 socket) - Runtime fail Invalid Arguments

Hi, I was porting ipv4 application to ipv6; i was done with TCP transports. Now i am facing problem with SCTp transport at runtime. To test SCTP transport I am using following server and client socket programs. Server program runs fine, but client program fails giving Invalid Arguments for... (0 Replies)
Discussion started by: chandrutiptur
0 Replies

7. IP Networking

IP Socket

Please need to setup a IP Socket on SCO Open Server 5.06 / 5.07 to a Linux machine. Al that I want to do is via a simple shell command open a tcpip address, port number, and send a call to a progam with a name of a file on the linux box. My programming language does not support socket... (1 Reply)
Discussion started by: comcaps
1 Replies

8. Shell Programming and Scripting

file editting with shell programmin

Hello, I have several handreds of text files. The format of file looks like: column1 column2 column3 column4 column5 id1 definition1 name1 fieldid comm1 id2 definition2 name2 fieldid ... (4 Replies)
Discussion started by: ssshen
4 Replies

9. Programming

Socket Programming socket

Hello, I actually try to make client-server program. I'm using SCO OpenServer Release 5.0.0 and when I try to compile my code (by TELNET) I've got this error : I'm just using this simple code : and I get the same error if I use : If someone can help me, Thanks (2 Replies)
Discussion started by: soshell
2 Replies

10. Shell Programming and Scripting

Books on Shell programmin

Can Anyone suggest few good books on Unix Shell Programming and C on Unix. Thanks Prasad (5 Replies)
Discussion started by: pswar70
5 Replies
Login or Register to Ask a Question
XQUERYDEVICESTATE(3)													      XQUERYDEVICESTATE(3)

NAME
XQueryDeviceState - query the state of an extension input device. SYNOPSIS
#include <X11/extensions/XInput.h> XDeviceState* XQueryDeviceState( Display *display, XDevice *device); display Specifies the connection to the X server. device Specifies the device whose state is to be queried. DESCRIPTION
The XQueryDeviceState request queries the state of an input device. The current state of keys and buttons (up or down), and valuators (current value) on the device is reported by this request. Each key or button is represented by a bit in the XDeviceState structure that is returned. Valuators on the device report 0 if they are reporting relative information, and the current value if they are reporting absolute information. XQueryDeviceState can generate a BadDevice error. Structures: The XDeviceState structure contains: typedef struct { XID device_id; int num_classes; XInputClass *data; } XDeviceState; The XValuatorState structure contains: typedef struct { unsigned char class; unsigned char length; unsigned char num_valuators; unsigned char mode; int *valuators; } XValuatorState; The XKeyState structure contains: typedef struct { unsigned char class; unsigned char length; short num_keys; char keys[32]; } XKeyState; The XButtonState structure contains: typedef struct { unsigned char class; unsigned char length; short num_buttons; char buttons[32]; } XButtonState; DIAGNOSTICS
BadDevice An invalid device was specified. The specified device does not exist or has not been opened by this client via XOpenInputDevice. This error may also occur if some other client has caused the specified device to become the X keyboard or X pointer device via the XChangeKeyboardDevice or XChangePointerDevice requests. 03/09/2013 XQUERYDEVICESTATE(3)