TCPClose[Async]


C Specification

#include <dolphin/ip.h>

typedef void (* TCPCallback )(TCPInfo* info, s32 result);

s32 TCPClose     ( TCPInfo* info );

s32 TCPCloseAsync( TCPInfo* info,
                   TCPCallback callback, s32* result );

Description

TCPCloseAsync() closes a TCP connection. If the connection has been established, TCPCloseAsync() lingers until it receives the acknowledgement for the FIN segment from the other end of the connection. Otherwise it aborts current TCPConnect() or TCPListen() as well as any other queued operations.

Arguments

info Pointer to TCPInfo to close.
callback Informed when a connection is closed.
result Optional pointer to s32 that receives the function result. While the operation is in progress, the value *result  is set to IP_ERR_BUSY.

Return Values

IP_ERR_NONE Succeeded.
IP_ERR_INVALID info is not a valid TCPInfo.
IP_ERR_CLOSING Connection closing.

See Also

TCPConnect(), TCPListen()