www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


send

Transmit a message.

int send ( int sd, const char far *bufptr, int bufLen,
           int flags, int *error );

Parameters

sd

Socket descriptor.

bufptr

Pointer to output buffer containing data to be transmitted.

bufLen

Maximum characters to output from bufptr .

flags

Wait option:
  • MSG_BLOCKING - Wait for data send to complete.
  • MSG_DONTWAIT - Don't wait for data send to complete.

error

Output parameter:  Failure code, 0 on success.

Return Value

-1: Failure, see error value reported
otherwise: Count of bytes transfered into the socket send queue

Comments

This API function applies only to TCP sockets.   It transmits a message to another transport end-point.   It may be used only if the socket is in a connected state.

The MSG_BLOCKING mode will not work if the socket has been put into non-blocking mode using the Set_Blocking_Mode API.

SC1x3/SC2x Comments

This legacy version of send() specified here is not compatible to the BSD 4.4 Socket API.   The
send() function can be used in BSD 4.4 compatible mode if the compilation switch

     #define BSD44_SOCKET_API_STYLE

is defined in the user application prior to including the Beck C-Library header files.   Using this switch the C-Library TCPIP_Socket.H include file redefines send() to send_bsd().  The parameters to send_bsd() are identical to the parameters of the BSD4.4 socket send() function.

The send_bsd() method uses dynamical linking, so therefore executes faster than this legacy API's sofware interrupt method. The compilation switch

     #define TCPIP_DYN_LINK_SOCK

may be defined in the user application prior to including the Beck C-Library header files to implement this legacy send() method using the faster send_bsd() dynamic linked API.

The first compilation switch takes precedence.   This second compilation option, TCPIP_DYN_LINK_SOCK will be not affect this API when the first option (BSD44_SOCKET_API_STYLE ) is defined.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    V1.00V1.00V1.00V0.90V1.00

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document