@@ -456,7 +456,7 @@ function send(sock::UDPSocket, ipaddr::IPAddr, port::Integer, msg)
456
456
finally
457
457
Base. sigatomic_end ()
458
458
iolock_begin ()
459
- q = ct. queue; q === nothing || Base. list_deletefirst! (q:: IntrusiveLinkedList{Task} , ct)
459
+ q = ct. queue; q === nothing || Base. list_deletefirst! (q:: Base. IntrusiveLinkedList{Task} , ct)
460
460
if uv_req_data (uvw) != C_NULL
461
461
# uvw is still alive,
462
462
# so make sure we won't get spurious notifications later
474
474
475
475
476
476
# from `connect`
477
- function uv_connectcb (conn:: Ptr{Cvoid} , status:: Cint )
477
+ function uv_connectcb_tcp (conn:: Ptr{Cvoid} , status:: Cint )
478
478
hand = ccall (:jl_uv_connect_handle , Ptr{Cvoid}, (Ptr{Cvoid},), conn)
479
- sock = @handle_as hand LibuvStream
479
+ sock = @handle_as hand TCPSocket
480
+ connectcb (conn, status, hand, sock)
481
+ end
482
+
483
+ function uv_connectcb_pipe (conn:: Ptr{Cvoid} , status:: Cint )
484
+ hand = ccall (:jl_uv_connect_handle , Ptr{Cvoid}, (Ptr{Cvoid},), conn)
485
+ sock = @handle_as hand PipeEndpoint
486
+ connectcb (conn, status, hand, sock)
487
+ end
488
+
489
+ function connectcb (conn:: Ptr{Cvoid} , status:: Cint , hand:: Ptr{Cvoid} , sock:: LibuvStream )
480
490
lock (sock. cond)
481
491
try
482
492
if status >= 0 # success
@@ -508,7 +518,7 @@ function connect!(sock::TCPSocket, host::Union{IPv4, IPv6}, port::Integer)
508
518
end
509
519
host_in = Ref (hton (host. host))
510
520
uv_error (" connect" , ccall (:jl_tcp_connect , Int32, (Ptr{Cvoid}, Ptr{Cvoid}, UInt16, Ptr{Cvoid}, Cint),
511
- sock, host_in, hton (UInt16 (port)), @cfunction (uv_connectcb , Cvoid, (Ptr{Cvoid}, Cint)),
521
+ sock, host_in, hton (UInt16 (port)), @cfunction (uv_connectcb_tcp , Cvoid, (Ptr{Cvoid}, Cint)),
512
522
host isa IPv6))
513
523
sock. status = StatusConnecting
514
524
iolock_end ()
0 commit comments