473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New programmer and network.

While teaching myself to program, I've undetaken a little game project akin to Battleship only it's not turn-based. The stand-alone version is working fine but I'd like to expand it to include a head-to-head feature.

With the program running on two computers, I wish to manually input the IP of the opponent into each. Then, I expect each event handled by one program to generate a network message received and interpeted by the opponent.

I was expecting (hoping) to find something like TCP.Send(target IP, target Port, string) but no such luck. Instead, I seem to be hung up on two issues I hadn't really anticipated: sockets and blocking/non-blocking.

Can someone advise me where to follow up on this? I could use some very basic pointers.
Nov 15 '05 #1
4 1189
n!
> I was expecting (hoping) to find something like TCP.Send(target IP, target
Port, string) but no such luck. Instead, I seem to be hung up on two issues
I hadn't really anticipated: sockets and blocking/non-blocking.

DirectPlay provides a complete framework to help implement a networked game,
I'd suggest you use that. There are many issues with networking and using
raw sockets makes a lot of work for yourself. The DirectX SDK can be
downloaded at http://msdn.microsoft.com/directx.

n!
Nov 15 '05 #2
Thanks, n!, that makes considerable sense. I guess it would be the way to go if the primary objective of this little game weren't to teach me how to program in general :) I really want to overcome this basic networking issue... just to send and receive packets. I don't even care about timing yet!
Nov 15 '05 #3
n!
> Thanks, n!, that makes considerable sense. I guess it would be the way to
go if the primary objective of this little game weren't to teach me how to
program in general :) I really want to overcome this basic networking
issue... just to send and receive packets. I don't even care about timing
yet!

Well it's not all about timing, there's management of dropped\lost packets
amongst other things :)
If you really want to look at sockets & raw communication I'd suggest
looking at the 'WinTalk' sample that is installed with the .NET framework
SDK (should be under \samples\Applic ations\Wintalk) . Which implements a
simple 'chat' application using sockets. Should be enough there to get you
going!

n!
Nov 15 '05 #4
Excellent, n!! I didn't even know about the samples directory. Thanks a lot :)
Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2436
by: Angie | last post by:
Hello, My name is Angela Mastrodonato. I'm a web designer who would like the assistance of a php programmer. Some of my clients have requested more dynamic web sites, and I am in the beginning phases of learning php. When it comes to common services, such as shopping carts, I have found ways to modify existing scripts. However, I have...
7
2060
by: stormslayer | last post by:
Folks: I've been considering a shift to python. I currently use c++builder (borland) or perl. I do computational models / statistics programming, and was interested in python b/c it a. has a library that connects to the R stats package b. has code that seems way more readable than anything else There is, however, at least for my...
8
1693
by: Beatrice Rutger | last post by:
Hi, I am a previous Micro$oft desertee (moved from VB/VC++ to Java before this whole DOTNET thing) because I had several issues with Micro$oft. I am not completely in love with Windoze, but I have to say that Java SWING sucks BIG TIME for developing and deploying desktop applications (especially on Windoze). Unfortunately, I have been...
0
1059
by: Wim Hoogenraad | last post by:
Dear developer, Do you often wonder who built a certain website and how it is done? And who manages that website right now? Strange, but developers usually stay anonymous while they should present themselfs to get more orders. We have been working on a website to change this situation: WebmastersLookup.com. It's a special Searchengine...
8
1979
by: markus | last post by:
Hi, As I been programming in C I have discovered more and more tools that really helps to speed up the development process when writing programs. Examples of such tools are cscope, cbrowser, tags, etc. There are ofcourse many different levels of programmers, and the beginners might only use emacs or vi to write their code. However, since...
2
1614
by: 1solomon | last post by:
Access/SQL Programmer/Developer required ongoing work with a client. - $55 per hour - Technical Requirements - or Equivalent in know how. 1. 5+ years or Windows Software Development. 2. 3+ years MS SQL development experience. 3. Experience using Access as a front end development tool. 4. Able to takeover existing design 5. Able to...
65
5243
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective than the descriptions of OOP I've read in making a case. Ie., what objective data/studies/research indicates that a particular problem can be...
0
3765
by: nancylife | last post by:
When developing web report, many developers use VMware to simulate different operating systems on a same server. Then, they can realize cross-platform deployment and debug of web report. According to real application of web report, I will discuss three network setting ways of VMware with all of you. Bridge way This is the simplest way as it...
0
7849
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.