How to manage multiple connections from a server socket ?

Hi there.

I need to make a server at julia, but i can’t find a way to receive multiple connections in parallel to my communication code.

In the code below:

  1. The server is capable to receive connections outside the @async block;
  2. Julia prints an invalid connection server inside the @async block.
using Sockets
server = listen( 4000 )
frame_idx = 10000

println( "waiting for clients ... " )	

@async while true
	global server

	println( server )
	client = accept( server )
	println( "client connected with id ", client )
end

Any suggestions to solve this issue ?
Best regards.