Operator Reference

socket_accept_connectT_socket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connect (Operator)

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

Signature

socket_accept_connect( : : AcceptingSocket, Wait : Socket)

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

void SocketAcceptConnect(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)

static void HOperatorSet.SocketAcceptConnect(HTuple acceptingSocket, HTuple wait, out HTuple socket)

HSocket HSocket.SocketAcceptConnect(string wait)

def socket_accept_connect(accepting_socket: HHandle, wait: str) -> HHandle

Description

socket_accept_connectsocket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connect accepts an incoming connection request, generated by open_socket_connectopen_socket_connectOpenSocketConnectOpenSocketConnectopen_socket_connect in another HALCON process or from an external application, on the listening socket AcceptingSocketAcceptingSocketAcceptingSocketacceptingSocketaccepting_socket. The listening socket must have been created earlier with open_socket_acceptopen_socket_acceptOpenSocketAcceptOpenSocketAcceptopen_socket_accept. Its timeout determines the timeout of the socket_accept_connectsocket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connect call. If WaitWaitWaitwaitwait='true'"true""true""true""true", socket_accept_connectsocket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connect waits until a connection request from another HALCON process arrives. If WaitWaitWaitwaitwait='false'"false""false""false""false", socket_accept_connectsocket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connect returns with the error 5 ( H_MSG_FAIL) , if currently there are no connection requests from other HALCON processes. The value 'auto'"auto""auto""auto""auto" for WaitWaitWaitwaitwait automatically waits if the timeout of the accepting socket is not equal 0. The result of socket_accept_connectsocket_accept_connectSocketAcceptConnectSocketAcceptConnectsocket_accept_connect is another socket SocketSocketSocketsocketsocket, 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_acceptopen_socket_acceptOpenSocketAcceptOpenSocketAcceptopen_socket_accept.

For the data transfer with generic sockets only the operators send_datasend_dataSendDataSendDatasend_data and receive_datareceive_dataReceiveDataReceiveDatareceive_data are available.

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

AcceptingSocketAcceptingSocketAcceptingSocketacceptingSocketaccepting_socket (input_control)  socket HSocket, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Socket number of the accepting socket.

WaitWaitWaitwaitwait (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Should the operator wait until a connection request arrives?

Default: 'auto' "auto" "auto" "auto" "auto"

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

SocketSocketSocketsocketsocket (output_control)  socket HSocket, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Socket number.

Possible Predecessors

open_socket_acceptopen_socket_acceptOpenSocketAcceptOpenSocketAcceptopen_socket_accept

Possible Successors

send_imagesend_imageSendImageSendImagesend_image, receive_imagereceive_imageReceiveImageReceiveImagereceive_image, send_regionsend_regionSendRegionSendRegionsend_region, receive_regionreceive_regionReceiveRegionReceiveRegionreceive_region, send_tuplesend_tupleSendTupleSendTuplesend_tuple, receive_tuplereceive_tupleReceiveTupleReceiveTuplereceive_tuple, send_datasend_dataSendDataSendDatasend_data, receive_datareceive_dataReceiveDataReceiveDatareceive_data

See also

open_socket_connectopen_socket_connectOpenSocketConnectOpenSocketConnectopen_socket_connect, close_socketclose_socketCloseSocketCloseSocketclose_socket, get_socket_paramget_socket_paramGetSocketParamGetSocketParamget_socket_param, set_socket_paramset_socket_paramSetSocketParamSetSocketParamset_socket_param

Module

Foundation