|
-
April 6th, 2004, 07:51 AM
#1
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
Life is like riding a bicycle To keep ur Balance u have to keep riding.
-
April 6th, 2004, 08:01 AM
#2
-
April 6th, 2004, 08:09 AM
#3
Check out the following articles.
Amit
-
April 6th, 2004, 03:59 PM
#4
To answer your direct question, I think gethostbyname will do what you asked.
-
April 8th, 2004, 05:39 AM
#5
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.
Even if our suggestions didn't help, please post the answer once you find it. We took the effort to help you, please return it to others.
* While posting code sections please use CODE tags
* Please check the codeguru FAQ and do a little search to see if your question have been answered before.
* Like a post, Rate The Post
* I blog: Network programming, Bible
I do all things thru CHRIST who strengthens me
-
April 8th, 2004, 05:44 AM
#6
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.
"UNIX is simple; it just takes a genius to understand its simplicity!"
-
April 8th, 2004, 06:26 AM
#7
-
April 8th, 2004, 06:27 AM
#8
-
April 8th, 2004, 07:56 AM
#9
Content deleted by author. Not appropriate after threads were merged.
Last edited by TheCPUWizard; April 13th, 2004 at 04:45 AM.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
April 8th, 2004, 11:32 AM
#10
[Merged threads]
Poorni, please stop creating new threads for the same question. Thank you very much.
-
April 13th, 2004, 12:17 AM
#11
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
Life is like riding a bicycle To keep ur Balance u have to keep riding.
-
April 13th, 2004, 04:02 AM
#12
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...
-
April 13th, 2004, 05:09 AM
#13
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
Life is like riding a bicycle To keep ur Balance u have to keep riding.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|