-
Chatting
Hi all,
hope everybody is dng fine....i have a doubt actually i am trying to simulate chatting between two machnies within same LAN using MFC.its like i will get the computer name to which the user want to chat.Now after this is there any method to get the IP address of this machine and then establish communication with it?
plz help me
Thanks in advance
Poorni
-
-
Check out the following articles.
:wave:
Amit
-
To answer your direct question, I think gethostbyname will do what you asked.
-
Please keep similar questions in the same thread.
You can use the API gethostbyname() to get the ip.
To establish connection, you can use socket() and related functions (WinSock programming). However you have to do some learning before you start to write. Codes and tutorials are there in the web. You can search this forum itself. A good site ishere.
-
Re: connection
If it's considered to use tcp/ip communication, U should look at the following functions:
socket(), connect(), send(), etc.
For UNIX system read man pages for them.
For Win, there's a good overview here: http://www.tangentsoft.net/wskfaq/
in additon to documentation in MSDN (serach for winsock).
There's a lot of other tutorials via the Web, just search.
-
-
-
Content deleted by author. Not appropriate after threads were merged.
-
[Merged threads]
Poorni, please stop creating new threads for the same question. Thank you very much.
-
Connection
hi all,
Thanks for the info u all have given me for the previous messages.Now the chatting application i have tried is working fine in one machine i.e.. the same application can act as server and also client.I first have to run the server and made to wait in Listen mode ,then i will run the second instance of the program which acts as client and it communicates with the server which is listening and then data can be exchanged between the applications .Now the same application with server running in one machine and client in another machine is not working i.e i couldnt establish connection between the two.Now Can anyone tell me the port number thru which we can communicate with another machine.I am using port no.4000.Plz help me
Thanks in advance,
Poorni
-
Well...there are some ports in the lower range (< 1025 or similar) which you should not use. However, 4000 should not make a problem. Nevertheless, just to make sure...the number must be the same for the server and client...
-
thanks
hi all,
Thanks for all of ur help.Now my chat program is working.Expecting the same kind of reply from u people in future also.
Thanks
Poorni