Welcome to Dream.In.Code
Become a Java Expert!

Join 149,602 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,908 people online right now. Registration is fast and FREE... Join Now!




Help with Client/Server basic program.

 
Reply to this topicStart new topic

Help with Client/Server basic program.

itsjustme82
16 Oct, 2007 - 01:15 PM
Post #1

New D.I.C Head
*

Joined: 29 Sep, 2007
Posts: 16


My Contributions
Hi i am trying to write a code for server/client.
I was able to write the code successfully.

1) How can i add 2 users who can connect only one at a time to the server and once they are done the other can connect.
2) Do i have to write the code at CLient or Server to verify the user. wub.gif
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Help With Client/Server Basic Program.
16 Oct, 2007 - 02:54 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
1) Once a user connects, stop listening for connections. That or don't accept incoming connections. When your first connection is closed, go back to listening for more connections again.

2) You should have the server challenge a connection (ask for username and pass), have the client send the information to answer the challenge and verify the user on the server. You can't trust anything that a client gives you and thus must do the verification there. Plus usually the server is the one with access to the list of authorized users and can look it up quickly.

Hope that answers your questions. smile.gif
User is online!Profile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 11:47PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month