LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Infomration regarding the send() and recv() function (https://www.linuxquestions.org/questions/linux-networking-3/infomration-regarding-the-send-and-recv-function-612594/)

karimasif 01-10-2008 08:24 AM

Infomration regarding the send() and recv() function
 
Hi

I am working on a send and recv function used to send traffic over a socket. I just want to know what are the "total" functions of send() and recv() functions.

- Does send() function, after sending the packet, waits for the acknowledge from the server (if connection oriented)

- If I want to catch a response from the server, and I am using the recv() function, then I will get the reply of my request using the same socket.

e.g. if I am sending the HTTP request packet and the response of it which might HTTP 1.1/ 200 or 404 or else how can i get it.

I am able to send the request but I tried to get the response such like http response or ftp response but fails.

Can some one help me.

Looking_Lost 01-13-2008 10:49 AM

I'm just learning myself all be it wrapping it up in a C++ class. As far as I know send does what it says - it sends the data and recv receives, you don't worry about the tcp/handshake and all that lower level stuff but react depending upon any errors received or not via their return values.

You use the same socket to send and receive and you'll have to parse the response to make use of it in the particular context you're using the data, or in the case of a text/html page you can just display the response in a console to see if it's worked.

Like I said though, just beginning in this particular area so if I'm wrong, I'm more than happy to be corrected.


All times are GMT -5. The time now is 08:27 PM.