network between XP and Windows 7

BlitzPlus Forums/BlitzPlus Programming/network between XP and Windows 7

Dan60(Posted 2010) [#1]
Has anybody tried it?
I used to have my game working a long time ago with two XP computers.
Now can not get it to work with windows 7 and XP.
But I am able to share files, and printer etc. from windows, no problem.

I used IPconfig to get my computers IP address.
Any suggestions?


xlsior(Posted 2010) [#2]
Could be windows firewall blocking either incoming or outgoing connections on the port that you're using...

(Or possibly a 3rd party program like zonealarm, or even antivirus program if you're using a suspicious port like 25)


Dan60(Posted 2010) [#3]
I got it to work with a XP laptop, still can't get it to work with Windows 7
I tried disabling firewall and antivirus program

Do I need to mess with network adpater properties more specifically
Intel 8256v-2 Gigabit network connection properties


xlsior(Posted 2010) [#4]
Do I need to mess with network adpater properties more specifically


Very unlikely.

There are differences between XP and Windows 7 though. It's also possible that the communication *port* that you're using may already be in use by another program.

- What port are you using?
- You can use Sysinternal's TCPView to see if there is already a program trying to use the same port as your app is


Dan60(Posted 2010) [#5]
I don't know how blitzplus selects port number....

I ran TCPView, (first time I've used it)


On the XP computer I can see that the program uses Ports 2300,2350,44999,57218

On the Windows 7 computer it seems to want to use 2300,2350,4894,9539

I'm no expert when it comes to ports or networks, so not sure what to look for. I don't know how I can tell if there is a port conflict.

I'm able to ping the computers... XP to windows 7 and Windows 7 to XP no problem.


xlsior(Posted 2010) [#6]
Assuming you are using the built-in networking commands, you specify the port you're listening on.

On the 'server': CreateTCPServer(port)
On the 'client': OpenTCPStream (ip$,port)

The 'port' parameter is the port used to listen on, and to send to.
(There's also a randomly assigned port for the outgoing traffic, but that port number is pretty much irrelevant as long as you aren't actively blocking the outgoing connection in a software firewall...

So...

- What port value are you specifying in your program?
- Check in TCP view to make sure that there is no other program listening on that specific port. For example, I've ran into problems there myself in the past because I was trying to run a webserver on port 80, but couldn't because Skype was already listening on that port for a fall-back connection.

Many common ports may already be in use by another application. Look at the contents of the file c:\windows\system32\drivers\etc\services to find a list of common ports that you should avoid to decrease the likelyhood of interfering with other programs and services...


Dan60(Posted 2010) [#7]
Looks like I've been using DirectPlay. I was not even aware of TCP(network). I originally wrote it in Blitzbasic not Blitzplus.
Do you recommend I rewrite it using TCP(network). Is there any examples of how to exchange variable data (integers and floating point) between the two computers.

Thanks
Dan


Stamm(Posted 2010) [#8]
I do recommend you to rewrite it using TCP commands.
Usually to set up a TCP connection you do something like

'server':
svr=CreateTCPServer(port)

Repeat
stream=AccepTCPStream(svr)
Until stream

'client':
stream=OpenTCPStream(ip,port)

Then you have a stream object (actually a pointer to the stream buffer)
in which you can write your data (and read it) using ReadByte, WriteString etc