Click here to Skip to main content
15,912,205 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
c# client program windows based it should get connected automatically to server or to a given host address,port.
Once it is connected it should be able to write and read from the socket .Write and read api's to be written separately.If it is disconnected it shd give status
Posted

Read my article : WCF Killer[^]
 
Share this answer
 
1)you need to use TCP/IP Protocol.
2)write one listner thread on server end.
3)when client login, client will send a message to server
4)server will keep listning for coming requests, so as server receive the request. server will see that either the request is of login type?
5)if request is of login, server will send response and login that perticular user (you need to send user info along with that specific msg)

6)same while logout, you will send specific string/msg to server along with your userName. server will listen and log you out from the server and response you back.

for code reference...
read chapter no 3 "Working with sockets" of book "Network programming in c#"


http://books.google.com.pk/books?id=ZmBzoG--oNAC&printsec=frontcover&dq=network+programming+in+c%23&hl=en&ei=2BOhTpvuHdCmrAfgsLCAAw&sa=X&oi=book_result&ct=result&resnum=2&ved=0CC8Q6AEwAQ#v=onepage&q&f=false[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900