473,698 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

server whih handles multiple clients

2 New Member
YOUR TASK IS AS FOLLOWS :
The server is written in such a way that only one client can connect to it at any time.modify the server sothat several clients can be connected to it(and later disconnect from it) simultaneously. In other words,the server should be able to maintain open TCP connections to several clients.
when a client sends a string to the server ,the server should display the string and send it to all other clients that are currently connected it.each client should do two things: strings entered via the keyboard should be sent to the server, and strings received from the server should be displayed on the console.

SOME EXTRA INFORMATION:
There are two normal ways for dealing with several open connections: The most common method is to use threads(sothat each connection is handled by a different thread).An alternative is to use non-blocking i/o (sothat,for example,calling a function to receive data over a socket will not block indefinitely if no data arrives).
in java,facilities for non-blocking i/o are available in the java.nio.* packages.In particular ,the classes ServerSocketCha nnel and ServerChannel provide non-blocking TCP sockets ,and Selector can be used to wait for one of several sockets to change status.
In c/c++ , a socket can be put into non-blocking mode using fcntl. Waiting for one of several sockets to change status can be implemented efficiently using select or poll.
Refer to UNIX manpages for descriptions of the socket operations and operations such as select ,poll,fcntl etc. in c/c++ or refer to the java API documentation for information about the java.net and java.nio packages.
Oct 30 '08 #1
1 1514
sukatoa
539 Contributor
What have you done so far?
Oct 30 '08 #2

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

Similar topics

7
5319
by: Sidd | last post by:
Hi, I tried finding and example of multithreaded client-serve program in python. Can any one please tell me how to write a multithreaded client-server programn in python such that 1.It can handle multiple connections 2.It uses actual threads and not select() or some other function
3
469
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 architecture into .Net -- not looking to do it at this time, just to understand how I would achieve it. In the old environment, we had two classes, a client and a server class, that managed a data object. The server object knew how to interface with the...
4
6730
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
0
4677
by: Macca | last post by:
Hi, I am writing an asychronous socket server to handle 20+ simulataneous connections. I have used the example in MSDN as a base. The code is shown at end of question. Each connection has a number of different types of data coming in. I have a databuffer for each type of data coming in.
2
6956
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
0
1512
by: 85ssp | last post by:
I am creating a small server client program that is meant for up to 70 connections from 70 different computers on a network. Everything in the program functions correctly except when testing operations with a server crash, the clients go into a disconnected state and wait for the server to come back up. Once the server is up the clients attept to connect. 75% of the time all clients connect and there connect message is accepted and...
1
1842
by: kurrachaitanya | last post by:
Lecture Saying that: I am generally expecting most of you to work n java.If you prefer to use c/c++ version of the programs,you may,but the assistance in the lab sessions will be very much geared towards java user. compile both the client and the server programs.open two shell windows on different machines(using e.g ssh or putty to log into another machine).run the server onn one machine,then run the client on the another machine and let it...
4
6534
by: Veeraraghavan | last post by:
Hi All, I am developing a client server communication using system.net.socket and I am finding it very difficult to get a solution for this. I started with single port communication with single client and as I was asked to develop to listen on multiple ports handling multiple clients, I am stuck with out a solution. The below is what could end up doing any help to solve the problem will be very much appreciated. Below is the code I...
0
8671
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8598
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9152
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9016
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7709
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4360
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2321
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.