[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Robert Larsen wrote: > Hvis man bruger blokerende sockets riscikerer man at komme til at vente > i et read kald (eller write). ? Lite pseudo-ada kod case Sockets.Selects(Channel.Fd, Int_Time_Out) is when Posix1.Int'first .. -1 => raise Get_Error; when 0 => raise Input_Timeout; when others => null; end case; Posix1.Read(Channel.Fd, Buffer(1..1), Nbyte); if Nbyte <= 0 then raise Get_Error; end if; Input := Byte(Buffer(1)); dvs anrop till select, om result >= -1 så har vi ett fel om result = 0 så har inget hänt på socketen på Int_Time_Out tid om result > 0 så har något hänt på Result många socketar En recv på socketen (om bara en i select-setet, och vi gör select på read) _kommer_ att lyckas, dvs inte blockera. Som vanligt, om vi får 0 från recv, har andra sidan kopplat ned. -- /Björn
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |