Seriously, i have a problem with my network. Look at the two codes i got for you:
Server code:
Code: Select all
messageA$="Dis is da first message"
messageB$="This is the second message"
OpenWindow(0,0,0,0,0,#PB_Window_SystemMenu,"Server")
InitNetwork()
If CreateNetworkServer(6789)
Repeat
event=NetworkServerEvent()
If event = 1
ID.l=NetworkClientID()
SendNetworkData(ID,@messageA$,Len(messageA$)+1)
SendNetworkData(ID,@messageB$,Len(messageB$)+1)
MessageRequester("mesg","Data has been sent")
EndIf
Until WindowEvent()=#PB_EventCloseWindow
EndIfCode: Select all
OpenWindow(0,0,0,0,0,#PB_Window_SystemMenu,"Client")
InitNetwork()
AllocateMemory(0,1000)
Connection.l=OpenNetworkConnection("127.0.0.1",6789)
If Connection
MessageRequester("mesg","Connected...")
Repeat
Delay(10)
event = NetworkClientEvent(Connection)
If event = 2
Delay(2500) ;delay some time to make sure that ALL data is received...
received.w=ReceiveNetworkData(Connection,MemoryID(),1000)
input$=PeekS(MemoryID(),received)
MessageRequester("input",input$)
EndIf
Until WindowEvent()=#PB_EventCloseWindow
EndIfIt seems as when i send two messages directly one after the other, only the first message arrives.
At first, the client says: Okay, connected and the server says 'okay i have sent the data.' after a short moment, the client says 'i have received some data: Blah blah blah'. But for me, it shows only the first message, not the second....
Is this just some weird behaviour of my machine or does the bug also appear for you?
Bye! merendo
