Skip to content

zsend()

Pradeep S B edited this page Aug 20, 2014 · 1 revision

#####int zsend ( int sockfd, const void * msg, int len, int flags)

zsend() call intercepts the send system call.

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

######Example Usage:

#include "zerosocket.h"
⋮
int bytes_sent;
int server_sock;
char data_sent[256];
⋮
bytes_sent = zsend(server_sock,data_sent, sizeof(data_sent), 0);

######Parameters

Parameter Description
sockfd The sockfd argument is a file descriptor that refers to a socket of type SOCK_STREAM or SOCK_SEQPACKET
msg 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 zsendto

send man send

Clone this wiki locally