Whenever I execute the following code snippet under Linux, I receive the Runtime Error regarding the SocketAccept every time the program is launched. When this same code is executed under Windows, no such error occurs and the code accepts client connections as expected. I suspect it's an issue with permissions, but I'm not sure. Any ideas?
Local Socket:TSocket = CreateTCPSocket()
BindSocket( Socket, 1234 )
If Not Socket Then
RuntimeError("Could not bind socket")
Else
Info("Started server")
EndIf
While Not CloseBackend
Local Giveup=False
Local Accept:TSocket = SocketAccept( Socket,100 )
If Not Accept Then
RuntimeError("Could not listen to socket")
Else
Info("Started listening to socket")
EndIf
SocketListen(Accept)
Local SocketStream:TStream = CreateSocketStream(Accept);
|