01-23-2006
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
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can Anyone suggest few good books on Unix Shell Programming and C on Unix.
Thanks
Prasad (5 Replies)
Discussion started by: pswar70
5 Replies
2. Programming
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
3. Shell Programming and Scripting
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
4. IP Networking
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
5. UNIX for Advanced & Expert Users
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
6. Programming
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
7. Programming
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
8. Programming
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
9. IP Networking
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
10. Programming
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
LEARN ABOUT DEBIAN
c-icap-client
c-icap-client(8) System Manager's Manual c-icap-client(8)
NAME
c-icap-client - simple ICAP client
SYNOPSIS
c-icap-client [ -i icap_servername ] [ -p port ] [ -s service ] [ -f input_file ] [ -o out_file ] [ -req url ] [ -d debug level ] [ -nore-
shdr ] [ -x icap-header ] [ -hx http-header ] [ -v ]
DESCRIPTION
c-icap-client is a simple ICAP client. It can be used to test your icap server configuration.
OPTIONS
-i icap_servername
The hostname of the icap server. The default is localhost
-p port
The server port. The default port value is 1344
-s service
The service name. The default service name is "echo"
-f filename
Send this file to the icap server. Default is to send an options request
-o filename
Save output to this file. Default is to send to stdout
-req url
Send a request modification instead of response modification, using as http url the url provided with this option.
-d level
debug level info to stdout
-noreshdr
Do not send reshdr headers
-x icap-header
Include the icap-header in icap request headers
-hx http-header
Include the http-header in http headers
-v Print response headers
SEE ALSO
c-icap(8) c-icap-stretch(8) c-icap-config(8) c-icap-libicapapi-config(8) c-icap-mkbdb(8)
BUGS
Many...
AUTHOR
Tsantilas Christos
c_icap 0.1.6 c-icap-client(8)