 |

|
The sample code works very well.
Thank you very much for posting it here.
---
The only improvement that could be helpful to others would be to make 1 program to allow either side of the connection to be the host or the client depending on which side initiated the connection.
---
All in all... very nice Server and Client Chat Programs.
Thanks again!
|
|
|
|

|
Hello,
If I want to use this program Client's side on my PC at home, and wish to connect to a "Server" that is behind a firewall somwhere... How do I conncet and get through the firewall?
Cheers
Alex
|
|
|
|

|
Alex,
If you look at the code you will find that it is set to use port 5000. (TCP/IP Winsock calls.)
* See the Client Program on this line of code: cli.sin_port=htons(5000);
* See the Server Program on this line of code: serv.sin_port=htons(5000);
You simply find the internal intranet address for "Server" PC and open port 5000 for inbound and outbound traffic on that PC via the Router and/or your software firewall program.
You would do the same if you want to allow port 5000 on your "Home" PC to connect to the "Server" PC.
It is pretty easy to do.
|
|
|
|

|
| hope hide... Optional. This allows you to set your preferences for the discussion boards
|
|
|
|

|
this happening to anyone else?
|
|
|
|

|
url read "secure.codeproject" researched and was able to download
|
|
|
|

|
A easy, useful, powerful code.
|
|
|
|

|
hi to all!!
is socket programming possible through xp home edition to professional edition between 2 pcs??
|
|
|
|

|
hi...........
can you please tell me how to use this code to allow
two systems(in the adjacent classrooms) to chat.
pranjal
|
|
|
|

|
hi...........
can you please tell me how to use this code to allow
two systems(in the adjacent classrooms) to chat.
|
|
|
|
|
|

|
Thanks For the code man. I think it is very usefull
N/A
|
|
|
|
|

|
nice work u've submitted
fairly simple to figure out
but for some people, it'd be nice if u
- formatted code im a more readable format
- included comments
- gave variables a more meaningful name
(i know it was last updated in 2002, but hey its still pretty useful)
apart from that, nice work *thumbs up*
|
|
|
|

|
How do i get rid of the graphical interface and just run the program from the comand prompt. Help would be greatlly appreciated.
|
|
|
|

|
I've struggled to make "no server chat system".
Your job gave me some senses....
I appriciate to you.
|
|
|
|

|
Hello Friends,
Actually I am try to develop the Application to manage my browsing center. I need given points
1. How many system currently connect to the internet
2. If the no of system connected, how long the system continue this connect.(when login/logout)
3. If the system is conneted, list out the user name.
4. If the user used printer, How many pages they printed.
5. If the user used cd-writer, How many CDs they writed.
Please send any helps tips my id or display FAQ Page
|
|
|
|

|
i learn my ip form www.whatsmyip.org and i wrote it to client program's server ip textbox.
but it cannot connect to the server although server runs. normally, if i use 127.0.0.1 they can communicate with each other. whats the problem? i suppose the problem is these programs use a port that windows don't open it to internet..
can anybody help me?
|
|
|
|

|
Maybe your program is behind the firewall.
|
|
|
|

|
i am a beginer to socket programming, i read your article i think it the best for beginers like me,
my question is i want the application to act as server and client simultaneously, and can chat with multiple peers simultaneously. what should i do to make the application work in the above mentioned way,
thanks and bye.
ShehrYar.
|
|
|
|

|
While learning, it would be best to do ONLY 1 server and 1 client.
When you start to go beyond 1 to 1 connections, that gets a bit tricky to send and receive the messages between multiple connections. Especially when you have people coming and going in the Text Chat. It can be done... but takes a lot of attention to detail to get that done. Unless you want to spend a lot of time, you might want to use programs like ICQ that do that already.
The easiest way to handle multiple connections on the server would be to have a list of connected IP Addresses, then: (1) when a message is sent out from Server send that message to each connected IP Address; or (2) when a message is received (incoming) at the Server, then send out that message to each connected IP Address except for the one that just sent the message to the server.
Keeping a list of connected IP Addresses wouldn't necessarily be difficult but you have to consider what happens when a connection is dropped, and much more.
|
|
|
|

|
Hi, I have a question? How to transmit image file using CSocket? I cannot figure it out.. Pls help me.... Thx
|
|
|
|

|
Instead of having an edit box, as in the picture, I have the IPnr 0.0.0.0 in the list. What is wrong?
|
|
|
|

|
Very nice piece of code.
I tried the code on Win 98 and It worked, but It gave me a bind error on Win XP.
Any idea what the problem might be?
|
|
|
|

|
The problem is cause i think windows xp binded the port 5000. so what you could do to get it working is to change the port to something else rather then 5000 for both client and server
|
|
|
|

|
I am using the given application but when i uses the code in my application the socket never binds and given socket = 4294967295.
But when i uses the given application it works fine, can you please guide me?
asim
|
|
|
|

|
Thaks...;)
Mbayer
|
|
|
|

|
An other great chat!
http://www.codeproject.com/useritems/ChatWithUS.asp
- The hell is paved good intentions.
|
|
|
|

|
Hah - Look at this fool plugging his own submission in another contributors message board. lame man, lame.
By the way, Essam - I didn't dl the project but from the brief it looks usefull especially for beginners - Thanks for making codeproject a little bit better.
|
|
|
|

|
It is your own opignion Anonymous!!!
Any way, fy!
- The hell is paved good intentions.
|
|
|
|
|

|
I really love this sample code on how to write a chat. Greate winsock sample. One thing though. When you write a program to communicate with a port and use threads its typically a good idea to set it's Process Priority setting high. To do this inside the thread() function in this case, near the begining put the following code:
::SetPriorityClass(::GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
This makes the program much less likely to lose, or corrupt data. The previous way rarely loses information, but to be safe you should add it.
Great work though. Thanks.
Ken Mazaika
|
|
|
|

|
i ran the server process on one machine and the client program on a different machine and did as it is told but it didnt work the client keeps waitin for the connection to establish....can u plz tell me how to make it run
|
|
|
|

|
The prog works perfect!(perhaps maybe a fixable memory leak).
You should check:
Are you using the right IP addess and port on both the Host and Client?
Are you using a firewall? If so, turn it off or make the use of the port in question possible.
I assure you it DOES work like a charm, it is on your side.
Tom
____________________________________
Using Visual Studio .NET Architect, including J++.
|
|
|
|

|
:(i ran both the sever and client programme on the same machine ,it does not work.The client machine keeps waiting.... Please tell me how to make it work.
|
|
|
|

|
Need help in designing a client server chat application
Now, I am summing it all up. 1. The client server need to be in different processes. 2. Communicate with TCP/ip sockets. 3. Communication is secured with SSL or S-HTTP. 4. Messages recorded in a server side database by the server. 5. A time stamp for each recorded message. 6. The client can request its messages from the server and display it in its own window. But can not change the messages.
abhishek
|
|
|
|

|
Now, I am summing it all up. 1. The client server need to be in different processes. 2. Communicate with TCP/ip sockets. 3. Communication is secured with SSL or S-HTTP. 4. Messages recorded in a server side database by the server. 5. A time stamp for each recorded message. 6. The client can request its messages from the server and display it in its own window. But can not change the messages.
|
|
|
|

|
Thank you;Thank you;Thank you!!!!!!!!!!!!!;P
|
|
|
|

|
LOL I agree with you 1000%.
Tom
____________________________________
Using Visual Studio .NET Architect, including J++.
|
|
|
|

|
HI!
I was searching within your project why you had memory leaks when the program exited. You use AfxBeginThread, that create a thread, but create a memory leak if you use C Run-Time Library.
In MSDN, they tell to use _beginthread() / _endthread()instead of AfxBeginThread / AfxEndThread()
I tried it in your app, and it worked, so if you would like to correct it, it would be great!
bye
Jack
papejack@hotmail.com
|
|
|
|

|
please i am learning vb6 code and have been trying to make a chat program if eny one could help me please. or even bet give me a program to do it we are at college and it is boring and the teacher told use to not go on the e-mail when we are in class and i want i new way if you can help here is my e-mail address (a5296@tcat.ac.uk) please sent programs to here thanks i lot.
conwaytowers
|
|
|
|

|
Can these project realize multi people communication at
the same time?
|
|
|
|

|
Thank you sir,
This really worked. I'd tested it.
Uday T.
(Development Engineer)
MSE (I) Pvt. Ltd. India.
|
|
|
|

|
I wanna know how many people can communicate together in the same time
|
|
|
|

|
Hello Sir ,
I'm new to this Socket Programming . Could you please explain it in detail.
On executing the Program , i'm getting both the dialog Boxes. But Dont Know How to proceed ???
Maria
Maria Jothi (Software Engineer)
MAIL-ID:maria@sdsindia.com
maria_jothi@usa.net
|
|
|
|
|

|
Thank You very much sir. I have been searching the code but couldn't find one. I am a beginner level programmer and find it difficult with multi-threading.
Thanking You again.
Yours sincerely
Amit Malik
|
|
|
|

|
How to know when the ConnectionRequest occurs in the thread?
and your code has bug when client disconnected. your code always receive
from buff.
|
|
|
|

|
I agree that a bug occurs on disconnecting the socket. Maybe calling CloseSocket is too early. If you simply terminate the client program, the server side handles this perfects. This means some instances or threads are not correctly released.
Antradar Software
|
|
|
|
 |