Home

Traffic Server Software Developers Kit

Netvconnection Functions

INKNetAccept

Accepts a TCP/IP connection on a specified port.

Prototype

INKAction INKNetAccept (INKCont contp, int port)

Arguments

INKCont contp is the continuation that's called back when a connection is accepted.

int port is the port that will listen for incoming TCP/IP connections.

Description

Accepts a TCP/IP connection on port. When Traffic Server receives a connection on a specified port, it calls back contp with the event INK_EVENT_NET_ACCEPT or INK_EVENT_NET_ACCEPT_FAILED.

If event is INK_EVENT_NET_ACCEPT, then the void * data passed to the handler of the continuation contp is a NetVConnection datatype that represents the connection.

If event is INK_EVENT_NET_ACCEPT_FAILED, then it means a connection attempt was aborted or failed. The plugin should just return from the continuation's handler.

The user (contp) has the option to cancel the action returned by INKNetAccept by using INKActionCancel.

Returns

An INKAction object if successful.

INK_ERROR_PTR if an argument was incorrect or if the API failed.