Computer Science Canada

ways to transfer data between 2 computers

Author:  coolgod [ Thu Apr 28, 2011 12:02 pm ]
Post subject:  ways to transfer data between 2 computers

I'm writing a multiplayer game for school.
My socket client/server program doesn't work
both udp and tcp doesn't work.
Anyone know any other ways?
Ty

Author:  Insectoid [ Thu Apr 28, 2011 12:07 pm ]
Post subject:  RE:ways to transfer data between 2 computers

Perhaps you're doing it wrong.

Ask a general question, get a general answer. Be specific bro.

Author:  coolgod [ Sun May 01, 2011 1:22 am ]
Post subject:  Re: ways to transfer data between 2 computers

I'm looking for ways to send and recieve data between 2 computers on a school network.
I've tried using sockets and they some how don't work.
Perhaps school blocked somehow blocked it?
Besides UDP and TCP socket connections what are some common alternatives>?

Author:  DemonWasp [ Sun May 01, 2011 2:28 am ]
Post subject:  RE:ways to transfer data between 2 computers

There aren't terribly many common alternatives. Most forms of network communication are built on top of UDP or TCP sockets. I suppose technically you could write IP-level data, but chances are good that if UDP traffic is blocked, then IP will be too (UDP is just a slight extension to the IP-specification).

You would be well-advised to check that you didn't just screw up the setup first. Does your program work on your home network with multiple computers? Does it work on the school computer, with the client and server both on the same computer?

It's likely that the school blocked some kinds of traffic for security reasons, but there may be exceptions to the blocker rule that you can use.

Author:  coolgod [ Sun May 01, 2011 10:02 pm ]
Post subject:  Re: ways to transfer data between 2 computers

my program works on my home network.
I tried the server and client running on same school computer and it works.
My only original hope was through raw sockets.
According to MSDN raw sockets are only for admin XD.
Perhaps i'll dig up some more on Ip- level transport.
Starcraft and red alert lan games seem to work.
I don't know how they do it, maybe something about ICMP and IGMP?

Author:  DemonWasp [ Mon May 02, 2011 12:05 am ]
Post subject:  RE:ways to transfer data between 2 computers

ICMP is the control messaging protocol; it's not suitable for application-level networking, typically.

You shouldn't have to use raw sockets. I guarantee you that starcraft doesn't use them. Raw sockets are useful when you want to send malformed or atypical data.

Just to check, what port are you using? If it's below 1024, you shouldn't be able to allocate it, but Windows may have some silly exception where it works on the local machine, but not across the network.

Author:  coolgod [ Mon May 02, 2011 7:45 am ]
Post subject:  Re: ways to transfer data between 2 computers

i generally use a port above 1024 like 4888 2777 3957 any random large number.

Author:  DemonWasp [ Mon May 02, 2011 1:38 pm ]
Post subject:  RE:ways to transfer data between 2 computers

Can you post the code you're using to make the connection?

I'm running out of ideas at this point, to be honest, but seeing the connection code might help.

Author:  coolgod [ Tue May 03, 2011 11:26 pm ]
Post subject:  Re: ways to transfer data between 2 computers

I'm use to doing these networking in c under linux systems so i had to get use to the WSA, window sockets.
I did have doubts beginning after converting my c socket code so i found some good windows socket debugging code.
http://www.tenouk.com/Winsock/Winsock2example9.html
this is a great example code that lets me switch between udp and tcp easily.
none the less it still failed.
through some googling i found some freeware http://www.simplecomtools.com/ProductCart/pc/viewCategories.asp?idCategory=5
that helps me diagnose network. They could connect on same computer but not on others.

Author:  DemonWasp [ Wed May 04, 2011 9:29 am ]
Post subject:  RE:ways to transfer data between 2 computers

This probably has to do with how your school network is configured and how you're trying to connect. Without being on-hand or having access to any of the systems, it'll be hard to debug.

The reason that games work is that they typically announce themselves via multicast / broadcast, and then clients can use the announced location to connect. This will be different, somehow, then the information you're using to connect.

Are you connecting by computer name or by IP address? Is it the right IP address? Is the system name correct? You aren't, by any chance, always connecting to localhost or something silly?

Author:  coolgod [ Wed May 04, 2011 11:47 am ]
Post subject:  Re: ways to transfer data between 2 computers

my address and port are all correct.
I tested with a client in school and a server at home and the same thing happened.
I use tcp to try to debug.
When the client sents out the initial SYN packet it's not getting it.
Therfore it's sending alot and waiting for response.
It shuts down after 30 seconds because it didn't recieve a response back from server.
Had i specify the wrong port, or address it stops immediatly, not wait for 30 seconds.
I'm trying a packet sniffer to diagnose why the connections can't be made.

Author:  coolgod [ Wed May 04, 2011 4:46 pm ]
Post subject:  Re: ways to transfer data between 2 computers

the first SYN packet from the TCP is recieved on the server but the server doesn't sent the SYN-ACT packet.
interesting.


: