[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Communications, Volume 2

smux_close Subroutine


Ends communications with the SNMP agent.


SNMP Library (libsnmp.a)


#include <isode/snmp/smux.h>

int smux_close ( reason)
int reason;


The smux_close subroutine closes the transmission control protocol (TCP) connection from the SNMP multiplexing (SMUX) peer. The smux_close subroutine sends the close protocol data unit (PDU) with the error code set to the reason value. The subroutine closes the TCP connection and frees the socket. This subroutine also frees information it was maintaining for the connection.


reason Indicates an integer value denoting the reason the close PDU message is being sent.

Return Values

If the subroutine is successful, OK is returned. Otherwise, NOTOK is returned.

Error Codes

If the subroutine returns NOTOK, the smux_errno global variable is set to one of the following values:

invalidOperation Indicates that the smux_init subroutine has not been executed successfully.
congestion Indicates that memory could not be allocated for the close PDU. The TCP connection is closed.
youLoseBig Indicates that the SNMP code has a problem. The TCP connection is closed.

Implementation Specifics

This subroutine is part of the SNMP Application Programming Interface in the TCP/IP facility.

Related Information

The smux_error subroutine, smux_init subroutine, smux_register subroutine, smux_response subroutine, smux_simple_open subroutine, smux_trap subroutine, smux_wait subroutine.

List of Network Manager Programming References.

RFC 1227, SNMP MUX Protocol and MIB.

SNMP Overview for Programmers in AIX 5L Version 5.1 Communications Programming Concepts.

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]