Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Homework socket
I learned about the socket.I using winform of C# 2005.
Most server,client must write two separate programs.
Can write a chat program network LAN has both the function server client functionality?
Posted 14-Nov-11 2:33am
Edited 14-Nov-11 4:47am
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Here is the CP article
 
Introduction to TCP client server in C#[^]
  Permalink  
Comments
giatuan2011 at 14-Nov-11 23:21pm
   
Thank you.
Your solution is what I have learned.
I need a program for the server and client with form
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Yes it has both the functions.
  Permalink  
Comments
giatuan2011 at 14-Nov-11 23:24pm
   
Only one program is used for server and client are what you say?
I learned the two are separate
giatuan2011 at 14-Nov-11 23:25pm
   
Have You only one for both?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Yes.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

Any application can both listen to a TCP port (server) on connect to a remote TCP port (client). The only restriction is that (generally) only one application can bind to a port for listening.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Hi there,
 
Yes it is possible, but its performance would be at a low level.
to make a correct architecture and high performance networking software you should use a multi-threaded programming technics.
 

Best Regards.
  Permalink  
Comments
   
Why would you think performance would suffer? It's a chat application, and nothing more. If it were me, I'd make the program act as EITHER a server or a client. The first instance that fires up would be a server, and all other instances would be clients. Where is the performance degradation?
elgaabeb at 14-Nov-11 9:06am
   
giatuan2011 said :
"Can write a chat program network LAN has both the function server client functionality? "
==> He want to make a unique instance to act as client and sever.
he also said :
"Most server,client must write two separate programs"
He is not talking about two seperate programs client and server, that's classic and he knows this case.
you were talking about two instance, it will act as multi-threaded program and no performance ill would be observed!!
Please let the user who asked the question to judge on the response according to his aims!!
Thank you.
John Simmons / outlaw programmer at 14-Nov-11 10:11am
   
I know - I said make a program that can act as EITHER a client OR a server. The first instance that runs is the server and acts ONLY as a server. The 2nd instance that runs acts as a client, and ONLY a client. By definition, each instance is running on its own thread (or thread pool). That was the entire point of what I said.

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

  Print Answers RSS
0 OriginalGriff 381
1 Praneet Nadkar 237
2 Marcin Kozub 225
3 Sergey Alexandrovich Kryukov 195
4 Shweta N Mishra 161
0 OriginalGriff 8,284
1 Sergey Alexandrovich Kryukov 7,327
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,920


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 14 Nov 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100