Skip to content

socket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connectT_socket_accept_connect🔗

Short description🔗

socket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connectT_socket_accept_connect — Accept a connection request on a listening socket of the protocol type 'HALCON'"HALCON" or 'TCP'"TCP"/'TCP4'"TCP4"/'TCP6'"TCP6".

Signature🔗

socket_accept_connect( socket AcceptingSocket, string Wait, out socket Socket )void SocketAcceptConnect( const HTuple& AcceptingSocket, const HTuple& Wait, HTuple* Socket )static void HOperatorSet.SocketAcceptConnect( HTuple acceptingSocket, HTuple wait, out HTuple socket )def socket_accept_connect( accepting_socket: HHandle, wait: str ) -> HHandle

Herror T_socket_accept_connect( const Htuple AcceptingSocket, const Htuple Wait, Htuple* Socket )

HSocket HSocket::SocketAcceptConnect( const HString& Wait ) const

HSocket HSocket::SocketAcceptConnect( const char* Wait ) const

HSocket HSocket::SocketAcceptConnect( const wchar_t* Wait ) const (Windows only)

HSocket HSocket.SocketAcceptConnect( string wait )

Description🔗

socket_accept_connectSocketAcceptConnect accepts an incoming connection request, generated by open_socket_connectOpenSocketConnect in another HALCON process or from an external application, on the listening socket AcceptingSocketacceptingSocketaccepting_socket. The listening socket must have been created earlier with open_socket_acceptOpenSocketAccept. Its timeout determines the timeout of the socket_accept_connectSocketAcceptConnect call. If Waitwaitwait='true'"true", socket_accept_connectSocketAcceptConnect waits until a connection request from another HALCON process arrives. If Waitwaitwait='false'"false", socket_accept_connectSocketAcceptConnect returns with the error 5 (H_MSG_FAIL), if currently there are no connection requests from other HALCON processes. The value 'auto'"auto" for Waitwaitwait automatically waits if the timeout of the accepting socket is not equal 0. The result of socket_accept_connectSocketAcceptConnect is another socket Socketsocketsocket, which is used for a two-way communication with another process. After this connection has been established, data can be exchanged between the two processes by calling the appropriate send or receive operators. For a detailed example, see open_socket_acceptOpenSocketAccept.

For the data transfer with generic sockets only the operators send_dataSendData and receive_dataReceiveData are available.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

AcceptingSocketacceptingSocketaccepting_socket (input_control) socket → (handle)HTuple (HHandle)HSocket, HTuple (IntPtr)HHandleHtuple (handle)

Socket number of the accepting socket.

Waitwaitwait (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Should the operator wait until a connection request arrives?

Default: 'auto'"auto"
List of values: 'auto', 'false', 'true'"auto", "false", "true"

Socketsocketsocket (output_control) socket → (handle)HTuple (HHandle)HSocket, HTuple (IntPtr)HHandleHtuple (handle)

Socket number.

Combinations with other operators🔗

Combinations

Possible predecessors

open_socket_acceptOpenSocketAccept

Possible successors

send_imageSendImage, receive_imageReceiveImage, send_regionSendRegion, receive_regionReceiveRegion, send_tupleSendTuple, receive_tupleReceiveTuple, send_dataSendData, receive_dataReceiveData

See also

open_socket_connectOpenSocketConnect, close_socketCloseSocket, get_socket_paramGetSocketParam, set_socket_paramSetSocketParam

Module🔗

Foundation