TCPPutString Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
TCPPutString Function
C
BYTE* TCPPutString(
    TCP_SOCKET hTCP, 
    BYTE* Data
);
Description

Writes a null-terminated string from RAM to a TCP socket. The null-terminator is not copied to the socket.

Preconditions

TCP is initialized.

Parameters
Parameters 
Description 
hTCP 
The socket to which data is to be written. 
data 
Pointer to the string to be written. 
Returns

Pointer to the byte following the last byte written to the socket. If this pointer does not dereference to a NUL byte, the buffer became full or the socket is not connected.

Remarks

The return value of this function differs from that of TCPPutArray. To write long strings in a single state, initialize the *data pointer to the first byte, then call this function repeatedly (breaking to the main stack loop after each call) until the return value dereferences to a NUL byte. Save the return value as the new starting *data pointer otherwise.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.