<< Previous | Index | Next >>

sock_puts


int sock_puts( tcp_Socket *s, byte *dp );

Description

A string is placed on the output buffer and flushed as described under sock_flushnext(). If the socket is in ASCII mode, CR and LF are appended to the string. No other ASCII character expansion is performed. In binary mode, the string is sent as is.

Note that sock_puts() uses sock_write(), and thus may block if the output buffer is full. See sock_write() for more details.

Starting with Dynamic C 7.05, this function is only valid with TCP sockets.

Parameters

s

Pointer to a socket.

dp

Buffer to read the string from.

Return value

0: Length of string in dp.
-1: Function was called with a UDP socket (valid for Dynamic C 7.05 and later).

Library

TCP.LIB (Prior to DC 7.05, this was DCRTCP.LIB)

See also

sock_gets, sock_putc, sock_getc, sock_read, sock_write


TCP/IP Manual
Vol 1
<<Previous | Index | Next>> rabbit.com