Skip to content

zrecv()

Pradeep S B edited this page Aug 20, 2014 · 2 revisions

#####int zrecv ( int sockfd, void * buf, size_t len, int flags )

zrecv() call intercepts the recv system call.

zrecv() call may be used only when the socket is in a connected state (so that the intended recipient is known). the following call

zrecv (sockfd, buf, len, flags);

is equivalent to

zrecvfrom (sockfd,buf, len, flags, NULL, 0);

######Example usage:

#include "zerosocket.h"
⋮
int rc;
int server_sock;
char oob_data;
⋮
rc = zrecv (server_sock,oob_data,sizeof(oob_data),MSG_OOB);
if (rc > 0)
{
// Process the oob data from the sender
⋮
}

######Parameters

Parameter Description
sockfd The sockfd argument is a file descriptor that refers to a socket of type SOCK_STREAM or SOCK_SEQPACKET.
buf the message is found in buf
len length of data to send in buf
flags see send manual or follow link below to see possible flags

######Returns On success, zero is returned. On error, -1 is returned, and errno is set appropriately.

######See Also zrecvfrom

recv man recv


Clone this wiki locally