If InitNetwork()
If CreateNetworkServer(6832)
OpenWindow(0,50,50,640,480,#PB_Window_SystemMenu,"Test")
NetworkAttachWindow(WindowID())
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Network_Connect
Debug NetworkClientID()
Case #PB_Event_Network_Disconnect
Debug NetworkClientID()
Case #PB_Event_Network_Raw
Debug NetworkClientID()
Case #PB_Event_Network_File
Debug NetworkClientID()
EndSelect
ForEver
EndIf
EndIf
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
That would be cool, but network events aren't directly tied to a window. Perhaps WindowEvent() and the NetworkServer/ClientEvents() should be ditched for one Event() command.
~I see one problem with your reasoning: the fact is thats not a chicken~
yes but with an optional NetworkAttachWindow(WindowID()) like in my example it should be possible, no ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
This code won't work as the program will hold on WaitWindowEvent() and you will have no chance to unlock WaitNetworkEvent(). We could may be implement a WaitEvent() function which would lock and returns if an event occurs (dunno if it's really possible).