2013-04-10 22:43:41 -07:00
|
|
|
If InitNetwork() = 0
|
2014-01-17 05:32:22 +00:00
|
|
|
MessageRequester("Error", "Can't initialize the network !")
|
|
|
|
|
End
|
2013-04-10 22:43:41 -07:00
|
|
|
EndIf
|
|
|
|
|
|
|
|
|
|
Port = 8080
|
|
|
|
|
|
|
|
|
|
If CreateNetworkServer(0, Port)
|
2014-01-17 05:32:22 +00:00
|
|
|
Repeat
|
|
|
|
|
Delay(1)
|
|
|
|
|
SEvent = NetworkServerEvent()
|
|
|
|
|
If SEvent
|
|
|
|
|
ClientID = EventClient()
|
|
|
|
|
Select SEvent
|
|
|
|
|
Case #PB_NetworkEvent_Data
|
|
|
|
|
SendNetworkData(ClientID,@"Goodbye, World!",Len("Goodbye, World!"))
|
|
|
|
|
CloseNetworkConnection(ClientID)
|
|
|
|
|
EndSelect
|
|
|
|
|
EndIf
|
|
|
|
|
ForEver
|
2013-04-10 22:43:41 -07:00
|
|
|
Else
|
2014-01-17 05:32:22 +00:00
|
|
|
MessageRequester("Error", "Can't create the server (port in use ?).")
|
2013-04-10 22:43:41 -07:00
|
|
|
EndIf
|