Admnet api send socket functions – ProSoft Technology MVI69-ADMNET User Manual

Page 99

Advertising
background image

MVI-ADMNET ♦ 'C' Programmable

WATTCP API Functions

'C' Programmable Application Development Module with Ethernet

Developer's Guide

ProSoft Technology, Inc.

Page 99 of 122

February 20, 2013

6.5

ADMNET API Send Socket Functions

This section describes the ADMNET API Send Socket functions.

sock_write

Syntax

int sock_write( sock_type *skType, byte *data, int len);

Parameters

skType

Socket that will be used to send data.

data

Pointer to a buffer that contains data that will be sent to a server.

len

Length of the data specified to send.

Description
This function writes data to the socket being passed to the function. The function
will wait until the all the data is written.

Return Value
Number of Bytes that are written to the socket or -1 if an error occurs.

Example

sock_type *socket;
char theBuffer [512];
int len, bytes_sent;

. . .

bytes_sent = sock_write(socket, (byte*)theBuffer, len);

See Also
sock_fastwrite (page 100)

Advertising