473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

More than one Client!!!!

Hello,
I have been working on a new project of a newtork game by this method:
http://www.codeproject.com/KB/game/eatergame.aspx

I have one server and one client. I am trying to add more than one client into the game but the server just ignores him. can someone explain me why?
Sep 9 '09 #1
1 1102
GaryTexmo
1,501 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. public void listenToClient()
  2. {
  3.     MessageBox.Show("ready to accept connections from the clients");
  4.     while (true)
  5.     {
  6.         if (host == null)
  7.         {
  8.             return;
  9.         }
  10.         if (host != null)
  11.         {
  12.             string move = (string) host.c.getObject(1);
  13.             if (move != null)
  14.             {
  15.                 doClientMove(move);
  16.             }
  17.         }
  18.     }
  19. }
I've never done a networked client before... well once, but it was several years back in University and using a C++ TCP/IP connection, single client. However, my first question would be if this is your listener, does it support threading?

I'd imagine you'd need your host to be listening for client connections, and when one is received it would need to create a thread to handle any incoming communication from that client. Or some other such way of handling concurrent connections.
Sep 9 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Rob R. Ainscough | last post by:
This is more of a conceptual question: 1. More and more companies are using VPN's and locking out internet connectivity (for a host of reasons, security, productivity, etc.). 2. ASP.NET...
0
by: Holger Fleckenstein | last post by:
Hi I have written a C++ server and an IDL client, that are supposed to communicate over sockets. Circumstances require, that only one client can connect at a time, and possible others are...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
18
by: cjl | last post by:
Hey all: I know that it is silly in the age of Google to 'lose' something on the internet, but I recently checked out a project that had implemented a database with a subset of SQL in pure...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
10
by: Ben | last post by:
Hi, I made an application in classic asp (reservation of books and video stuffs for students) and want to migrate to asp.net. The user has to chose a date, then pushung on a submit button. The...
11
by: Wayne | last post by:
I am a one man enterprise and have been asked by a prospective client what happens to their database regarding ongoing changes etc if I get hit by a bus. Obviously my databases are distributed...
2
by: kashifjawed | last post by:
I'm developing a c# asynchronous socket application for tranfering file or large data from client to server and server to client as well in chunks. Application sometimes transfer file from client...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.