Help with ReceiveNetworkData()
Posted: Sun Feb 01, 2004 4:06 am
I can't figure out this error... could someone help me?
If you could help, thanks a lot. 
Code: Select all
If OpenConsole()
If InitNetwork() = 0
End
EndIf
PrintN("TClient v0.1 by phunk")
PrintN("")
Print("What server would you like to connect to? ")
server$ = Input()
PrintN("")
Print("What port would you like to connect to? ")
port$ = Input()
ClearConsole()
PrintN("Connecting to "+server$+", port "+port$+"...")
telnet = OpenNetworkConnection(server$,Val(port$))
If telnet
PrintN("Successfully connected!")
Repeat
rT = NetworkClientEvent(telnet)
If rT = 2
; Error is here...
If ReceiveNetworkData(telnet, TelnetBuffer, 4096)
; The error is: The specified memory buffer is null.
PrintN("Read: "+PeekS(TelnetBuffer)+"")
Endif
EndIf
Until Inkey() = "q"
Else
PrintN("Could not connect.")
EndIf
EndIf
