A little TCP problem (reusing streams)...

Blitz3D Forums/Blitz3D Programming/A little TCP problem (reusing streams)...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Sorry, haven't got possibility to test this function right now (the other comp on our LAN is busy doing some filetransfers), but would this code work in the theory?:

Function Proto_BroadCast(p%)
  tempbuf = CreateBank(128)
  SeekFile(mp_server,0)
  CopyStream mp_server,tempbuf
	
  For mp.multiplayers = Each multiplayers
    SendUDPMsg mp_server,mp.multiplayers\ipint%,mp.multiplayers\port%
	
    CopyStream tempbuf,mp_server
  Next
	
  SendUDPMsg mp_server,0,0
	
  FreeBank tempbuf
End Function


I don't know if SeekFile can be used on UDP streams, neither I know if I can use CopyStream to copy the UDP stream to the bank. Neither I know if I can copy the bank back to the stream with CopyStream. And there must be an easier way to clear the UDP stream than sending it to an address that doesn't exist?