Neep help with a file sending program

Blitz3D Forums/Blitz3D Programming/Neep help with a file sending program

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.

whats wrong here:

server:

mainsvr=CreateTCPServer(8080) ;create the server
If mainsvr<>0 Then
Print "Server started successfully."
Else
Print "Server failed to start."
End
End If
fileout = WriteFile("file.txt")

While Not KeyHit(1)
strStream=AcceptTCPStream(mainsvr)

If strStream Then

WriteByte( fileout, ReadByte(strStream) )
End If
Wend
End



Client:

mainsvr=OpenTCPStream("127.0.0.1",8080)
If mainsvr<>0 Then
Print "Client Connected successfully."
Else
Print "Server failed to connect."
WaitKey
End
End If
name$ = Input("Name: ")
FlushKeys
; write stream to server
file=OpenFile("file.txt")
While Not Eof(file)
WriteByte mainsvr,ReadByte(file)
Wend