Click here to Skip to main content
15,177,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Guys!

I'm new at socket programming and I want to ask this question:
How will I connect 2 PCs inorder to have 2 clients? we've tried using the Port 8888 and the IP address 127.0.0.1...

It will be a great help if anyone could also give me some hints into how to output values to the server. We have our program in Snakes and Ladders and our only problem is to connect it via socket programming in VB .NET... :doh: :confused:

P.S

We've tried to search for days to how to connect it. :sigh:
Thank you!!!

I'm looking forward for your replies. :)
Posted
Comments
OriginalGriff 8-Mar-11 5:53am
   
Answer updated

1 solution

There is a tutorial with examples here[^]

127.0.0.1 is not helpful: it is automatically connected back to the original machine... http://www.tech-faq.com/127-0-0-1.html[^]
If you look at your Network connections in Control Panel, you can find the current IP address for your machine. Be aware it may change next time you turn your PC on!

"hi! but what if there's no internet connection? can there be any other ways to connect the 2 PCs?"

You don't need an internet connection, just a network: two pcs, two cat5 cables, and a router or switch.

Alternatively, you could directly connect them via a serial cable, but then you would need the SerialPort class rather than Sockets.
   
v2
Comments
   
OP commented:

hi! but what if there's no internet connection? can there be any other ways to connect the 2 PCs?
ladyemz21 8-Mar-11 6:14am
   
Thanks for the idea!
But I do still have lots of questions...

I looped the grids in the snakes and ladders inorder to lessen my code. How should I insert the socket programming code? I'm afraid it would be ruined. Can you give some advices or links or code snippets? Thank you!!
OriginalGriff 8-Mar-11 15:00pm
   
How could I possibly answer that? :laugh:
I can't read your hard disk at this distance!
   
Well, good tutorial reference and notes my 5.
--SA
   
@adyemz21:
I'm just curious, did you voted 3 just because you still have questions?
Please answer.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900