netWriteTCPStream

Writes data from a buffer to a TCP connection. Takes a handle (Int), buffer pointer (Int), and size (Int). Returns the number of bytes sent, or -1 on error (Int).

Network

Parameters & Returns

Parameters

handle Int
buffer Int
size Int

Returns

Int

Quick Summary

Writes data from a buffer to a TCP connection. Takes a handle (Int), buffer pointer (Int), and size (Int). Returns the number of bytes sent, or -1 on error (Int).

Technical Exegesis...

Sends 'size' bytes from the buffer to the TCP stream. Returns the number of bytes actually sent, or -1 on error (SOCKET_ERROR). Returns 0 if buffer is NULL, size is <= 0, or handle is invalid.

Uses send with the socket handle. The buffer parameter should be a pointer to the data to send. TCP guarantees ordered delivery, so bytes arrive in the same order sent. May send fewer bytes than requested if the send buffer is full. Useful for transmitting messages in client-server applications.

Example

Example.bam
; No example implemented yet