I am trying to communicate with a server that is ready to accept HTTP GET requests and send back data per the request. However, I have very little experience in socket programming and I don't really know how to debug this. Googling on the web hasn't yielded much, except people saying I need to read the HTTP 1.1 spec which is the last thing I want to do.
I seem to be able to create, bind the socket and then send a GET request and that seems ok too but I am not able to receive anything.
The following are the relevant parts of the code:
Connection established:
Sending request:
The above works fine, but then below the receiving fails, in the first if-statement:
Can anyone share some insight as to how I can re-write the receiving code to get the data that is supposed to be returned to be based on the GET request? What is wrong here?
Hi everybody,
I have a *.vbs file which I want to run automatically. I want to know if there is anyway to implement the given example
for e.g "http://255.255.255.55/script.vbs"
what I mean is does anyone know how to make an http request from a unix script??
Thanks in advance!!!!!!!!!!! (1 Reply)
Hi,
i need a guide how to write a script which i can do a http request. Let say the request look like below;
http://www.test.com?txid=1&type=service&server=linux
I have a list of "txid" (in *.txt) and need to run all "txid" acordingly. So that mean, every transaction i have to refer "txid"... (7 Replies)
Hi,
Maybe it's a stupid question, anyway here goes..
I have an Apache web server on Solaris box, let's say A, with a public ip
and a web application on a Linux box, uhmmm B, on a private lan with a private ip.
I want the people from outside to connect to the app, but its inside the lan,... (4 Replies)
Ok. I'm testing a new program component that is supposed to speed up our pipeline on the server. What it does is take in HEAD requests and shuffle them off to a different pipeline that is specially designed to handle HEAD requests quickly. The functionality works but now comes the question: how... (3 Replies)
Hi all,
Im trying to make an http get request to a web service from a linux machine like below and i get ERROR 500
wget http://10.1.21.236:8585/pns.asmx/Sen...&msgBody=werty
25018
$ --19:06:32-- http://10.1.21.236:8585/pns.asmx/Sen...erName=serverA
Connecting to 10.1.21.236:8585...... (1 Reply)
Hello,
I am using apache 2.2 and I need to have certain http requests (those including example.com for instance) to be executed normally and forwarded to another server.
With mod_rewrite, I could easily forward but then the input request would not be executed on my server. Right?
Am I... (1 Reply)
I am running a website but I still have problems with the "service temporarily unavailable error". I want to make a simple check if the website is up and running. Does anybody has an idea how to do it? (the site is password protected, so you have to add a user and pwd before logging in).
... (2 Replies)
Hi,
I am trying to write a shell script to parse the post request data that it received to a xml file. Below is the post request data that script is receiving.
-----------------------------7dd2339190c8e
Content-Disposition: form-data; name="param1"
1... (2 Replies)
Discussion started by: jdp
2 Replies
LEARN ABOUT HPUX
socket
socket(7) Miscellaneous Information Manual socket(7)NAME
socket - interprocess communications
DESCRIPTION
Sockets are communication endpoints that allow processes to communicate either locally or remotely. They are accessed by means of a set of
system calls (see socket(2)).
The following requests are defined in (see ioctl(2)):
If the int with the address
arg is non-zero, the socket is put into non-blocking mode. Otherwise, the socket is put into blocking mode. Blocking mode
is the default. The request is equivalent to the request, although using is not recommended. See accept(2), connect(2),
recv(2), and send(2) for an explanation of how non-blocking mode is used.
For SOCK_STREAM sockets, the number of bytes currently readable from this socket is returned in the integer with the address
arg. For SOCK_DGRAM sockets, the number of bytes currently readable, plus the size of the sockaddr structure (defined in is
returned in the integer with the address arg.
For SOCK_STREAM TCP sockets, on return the integer with the address arg is non-zero if the inbound TCP stream has been read up
to where the out-of-band data byte starts. Otherwise, the inbound TCP stream has not yet been read up to where the out-of-
band data byte starts. For sockets other than SOCK_STREAM TCP sockets, on return the integer with the address arg is always
zero.
This request sets the process group or process
ID associated with the socket to be the value of the integer with the address arg. A process group or process ID associated
with the socket in this manner is signaled when the state of the socket changes: is delivered upon the receipt of out-of-
band data; is delivered if the socket is asynchronous, as described in below. If the value of the integer with the address
arg is positive, the signal is sent to the process whose process ID matches the value specified. If the value is negative,
the signal is sent to all the processes that have a process group equal to the absolute value of the value specified. If
the value is zero, no signal is sent to any process. It is necessary to issue this request with a non-zero integer value to
enable the signal delivery mechanism described above. The default for the process group or process ID value is zero.
This request returns the process group or process
ID associated with the socket in the integer with the address arg. See the explanation for above for more details on the
meaning of the integer value returned.
If the integer whose address is
arg is non-zero, this request sets the state of the socket as asynchronous. Otherwise, the socket is put into synchronous
mode (the default). Asynchronous mode enables the delivery of the signal when either of the following conditions is met.
o New data arrives.
o For connection-oriented protocols, whenever additional outgoing buffer space becomes available or the connection is
established or broken.
The process group or process ID associated with the socket must be non-zero in order for signals to be sent. The signal is
delivered according to the semantics of described above.
The fcntl(2) and flags (defined in are supported by sockets. If the flag is set, the socket is put into POSIX-style non-blocking mode. If
the flag is set, the socket is put into non-blocking mode. Otherwise, the socket is put into blocking mode. Blocking mode is the default.
See accept(2), connect(2), recv(2), and send(2) for an explanation of how these forms of non-blocking mode are used.
Since the and flags and requests are supported, the following clarifies on how these features interact. If the or flag has been set, and
requests behave accordingly, regardless of any requests. If neither the flag nor the flag has been set, requests control the the behavior
of and
DEPENDENCIES
AF_CCITT Only
Only the and requests are defined for sockets.
AUTHOR
was developed by the University of California, Berkeley.
SEE ALSO fcntl(2), getsockopt(2), ioctl(2), socket(2).
socket(7)