Networking Q?

Blitz3D Forums/Blitz3D Beginners Area/Networking Q?

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.

First time in here for ages. but here goes anyway.

Server >>
;
; Server Test.
;
;	Simple test to see if I can create a server that will accept a connection
;	and reply to it with a bit of data.
;


Graphics 400,200,16,2
SetBuffer BackBuffer()
ClsColor 0,100,0

;
;	Server Details.
;
Global Server_IP%,Server_IPaddress$,Server_Port%,Server_Stream,Server_Lastmsg$

n 					= CountHostIPs("")
Server_IP 			= HostIP(1)
DebugLog server_ip

Server_IPaddress$ 	= DottedIP$(Server_IP)
Server_Port 		= 2222
Server_Stream		= CreateUDPStream(Server_Port)
Server_Lastmsg$		= "None Recvd"

;
;	Font Setup
;

Global font
font=LoadFont("Courier New",13,1)
Color 0,255,0
SetFont font

Repeat
	ClsColor 0,60,0
	Cls

		Text 1,1, "Server Running on Port  :"+UDPStreamPort(Server_Stream)
		Text 1,10,"Server Running on IP    :"+Server_IPaddress$
		Text 1,20,"+++++++++++++++++++++++++++++++++++++"
		Text 1,40,Server_Lastmsg$
				
		RecvUDPMsg(Server_Stream)
		t=ReadString (Server_Stream)
		If T<>0 Then DebugLog t
		If t<>"" Then Server_Lastmsg$=ReadString (Server_Stream)
	Flip
Until KeyHit(1)

End
CloseUDPStream Server_Stream




Client >>
;
; Server Test.
;
;	Simple test to see if I can create a server that will accept a connection
;	and reply to it with a bit of data.
;


Graphics 400,200,16,2
SetBuffer BackBuffer()
ClsColor 0,100,0

Global font
font=LoadFont("Courier New",13,1)
Color 0,255,0
SetFont font


;
;	UDP Connection Details.
;

Global Send_Stream,Send_IP
Send_Stream=CreateUDPStream(2221)
Send_IP=-1832933770

Repeat
	ClsColor 0,60,0
	Cls
		Text 1,1,"Connecting to  :: "+Send_IP+" on port 2222"
		Locate 1,10:Input txtmsg$
		Text 1,30,"Sending MSG ::"+txtmsg$
		WriteString Send_Stream,txtmsg$
		SendUDPMsg(Send_Stream,Send_IP,2222)
		
	Flip
Until KeyHit(1)

End
CloseUDPStream Stream



What am I doing wrong