@@ -287,7 +287,7 @@ Object accept(VirtualFrame frame, PSocket self,
287
287
checkSelectable (this , self );
288
288
289
289
try {
290
- PosixSupportLibrary .AcceptResult acceptResult = SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , self ,
290
+ PosixSupportLibrary .AcceptResult acceptResult = SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , self ,
291
291
() -> posixLib .accept (getPosixSupport (), self .getFd ()),
292
292
false , false );
293
293
try {
@@ -387,15 +387,15 @@ Object connect(VirtualFrame frame, PSocket self, Object address,
387
387
auditNode .audit (inliningTarget , "socket.connect" , self , address );
388
388
389
389
try {
390
- doConnect (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , self , connectAddr );
390
+ doConnect (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , self , connectAddr );
391
391
} catch (PosixException e ) {
392
392
throw constructAndRaiseNode .get (inliningTarget ).raiseOSErrorFromPosixException (frame , e );
393
393
}
394
394
return PNone .NONE ;
395
395
}
396
396
397
- static void doConnect (Frame frame , PConstructAndRaiseNode constructAndRaiseNode , PosixSupportLibrary posixLib , Object posixSupport , GilNode gil , PSocket self , UniversalSockAddr connectAddr )
398
- throws PosixException {
397
+ static void doConnect (Frame frame , Node inliningTarget , PConstructAndRaiseNode . Lazy constructAndRaiseNode , PosixSupportLibrary posixLib , Object posixSupport , GilNode gil , PSocket self ,
398
+ UniversalSockAddr connectAddr ) throws PosixException {
399
399
try {
400
400
gil .release (true );
401
401
try {
@@ -412,7 +412,7 @@ static void doConnect(Frame frame, PConstructAndRaiseNode constructAndRaiseNode,
412
412
waitConnect = self .getTimeoutNs () > 0 && e .getErrorCode () == EINPROGRESS .getNumber () && isSelectable (self );
413
413
}
414
414
if (waitConnect ) {
415
- SocketUtils .callSocketFunctionWithRetry (frame , constructAndRaiseNode , posixLib , posixSupport , gil , self ,
415
+ SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , posixSupport , gil , self ,
416
416
() -> {
417
417
byte [] tmp = new byte [4 ];
418
418
posixLib .getsockopt (posixSupport , self .getFd (), SOL_SOCKET .value , SO_ERROR .value , tmp , tmp .length );
@@ -440,13 +440,14 @@ Object connectEx(VirtualFrame frame, PSocket self, Object address,
440
440
@ Bind ("this" ) Node inliningTarget ,
441
441
@ Cached SocketNodes .GetSockAddrArgNode getSockAddrArgNode ,
442
442
@ Cached GilNode gil ,
443
- @ Cached SysModuleBuiltins .AuditNode auditNode ) {
443
+ @ Cached SysModuleBuiltins .AuditNode auditNode ,
444
+ @ Cached PConstructAndRaiseNode .Lazy constructAndRaiseNode ) {
444
445
UniversalSockAddr connectAddr = getSockAddrArgNode .execute (frame , self , address , "connect_ex" );
445
446
446
447
auditNode .audit (inliningTarget , "socket.connect" , self , address ); // sic! connect
447
448
448
449
try {
449
- ConnectNode .doConnect (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , self , connectAddr );
450
+ ConnectNode .doConnect (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , self , connectAddr );
450
451
} catch (PosixException e ) {
451
452
return e .getErrorCode ();
452
453
}
@@ -592,7 +593,7 @@ Object recv(VirtualFrame frame, PSocket socket, int recvlen, int flags,
592
593
}
593
594
594
595
try {
595
- int outlen = SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , socket ,
596
+ int outlen = SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , socket ,
596
597
() -> posixLib .recv (getPosixSupport (), socket .getFd (), bytes , 0 , bytes .length , flags ),
597
598
false , false );
598
599
if (outlen == 0 ) {
@@ -637,7 +638,7 @@ Object recvFrom(VirtualFrame frame, PSocket socket, int recvlen, int flags,
637
638
}
638
639
639
640
try {
640
- RecvfromResult result = SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , socket ,
641
+ RecvfromResult result = SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , socket ,
641
642
() -> posixLib .recvfrom (getPosixSupport (), socket .getFd (), bytes , 0 , bytes .length , flags ),
642
643
false , false );
643
644
PBytes resultBytes ;
@@ -704,7 +705,7 @@ Object recvInto(VirtualFrame frame, PSocket socket, Object bufferObj, int recvle
704
705
705
706
final int len = recvlen ;
706
707
try {
707
- int outlen = SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , socket ,
708
+ int outlen = SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , socket ,
708
709
() -> posixLib .recv (getPosixSupport (), socket .getFd (), bytes , 0 , len , flags ),
709
710
false , false );
710
711
if (!directWrite ) {
@@ -770,7 +771,7 @@ Object recvFromInto(VirtualFrame frame, PSocket socket, Object bufferObj, int re
770
771
}
771
772
772
773
try {
773
- RecvfromResult result = SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , socket ,
774
+ RecvfromResult result = SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , socket ,
774
775
() -> posixLib .recvfrom (getPosixSupport (), socket .getFd (), bytes , 0 , bytes .length , flags ),
775
776
false , false );
776
777
if (!directWrite ) {
@@ -813,7 +814,7 @@ int send(VirtualFrame frame, PSocket socket, Object bufferObj, int flags,
813
814
byte [] bytes = bufferLib .getInternalOrCopiedByteArray (buffer );
814
815
815
816
try {
816
- return SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , socket ,
817
+ return SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , socket ,
817
818
() -> posixLib .send (getPosixSupport (), socket .getFd (), bytes , 0 , len , flags ),
818
819
true , false );
819
820
} catch (PosixException e ) {
@@ -862,7 +863,7 @@ Object sendAll(VirtualFrame frame, PSocket socket, Object bufferObj, int flags,
862
863
try {
863
864
final int offset1 = offset ;
864
865
final int len1 = len ;
865
- int outlen = SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , socket ,
866
+ int outlen = SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , socket ,
866
867
() -> posixLib .send (getPosixSupport (), socket .getFd (), bytes , offset1 , len1 , flags ),
867
868
true , false , timeoutHelper );
868
869
offset += outlen ;
@@ -926,7 +927,7 @@ Object sendTo(VirtualFrame frame, PSocket socket, Object bufferObj, Object flags
926
927
byte [] bytes = bufferLib .getInternalOrCopiedByteArray (buffer );
927
928
928
929
try {
929
- return SocketUtils .callSocketFunctionWithRetry (frame , getConstructAndRaiseNode () , posixLib , getPosixSupport (), gil , socket ,
930
+ return SocketUtils .callSocketFunctionWithRetry (frame , inliningTarget , constructAndRaiseNode , posixLib , getPosixSupport (), gil , socket ,
930
931
() -> posixLib .sendto (getPosixSupport (), socket .getFd (), bytes , 0 , len , flags , addr ),
931
932
true , false );
932
933
} catch (PosixException e ) {
0 commit comments