accept

accept(server[,client])

Accepts a connection on the given server and returns a connection to the client. An uninitialized client stream may be provided, in which case it will be used instead of creating a new stream.

Examples

julia> server = ServerSocket(8080);  # Create a server socket
julia> client = accept(server);  # Accept a connection and get the client stream

In this example, accept is used to accept a connection on the server socket. It returns a connection to the client, which can be stored in the client variable. If an uninitialized client stream is provided, it will be used instead of creating a new stream.

julia> server = ServerSocket(8080);  # Create a server socket
julia> client = Socket();  # Create an uninitialized client stream
julia> accept(server, client);  # Accept a connection using the provided client stream

See Also

accept, bind, :@spawn, connect, fetch, getaddrinfo, gethostname, getipaddr, getsockname, init_worker, IPv4, IPv6, isready, issocket, kill, listen, recv, recvfrom, remotecall, remotecall_fetch, remotecall_wait, RemoteRef, send, setopt,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: