We help IT Professionals succeed at work.

TCP/IP Example required.

MoonCalf
MoonCalf asked
on
Hi.

I've got a client/server setup going at the moment that I would like to convert from using mailslots to using TCP/IP.

Basically, the reason I used mailslots was that the client and server would not be on a predefined machine.  The mailslots could be used to broadcast, systemwide, to request clients to report their location, the mail message holding the server's location.  That way, there was no problem.

If I was to have a server and a client that both used TCP/IP instead, how would I impliment this?

(The client's will be sat there, doing nothing, and need to be told - "Hey, the server's online and here's its IP address." so that they can connect as and when required, to wherever.)

This is all on an NT network, within the same domain.

MoonCalf.

BTW.  I will happily accept an example of enumerating every local PC and attempting to connect on a specific port number which the client and server both use - I just need some help coding it as I've never done any TCP/IP stuff before.
Comment
Watch Question

Commented:
HI,
On the CLIENT put both TServerSocket and TClientSocket.
Let ServerSocket be listening at some port.
When the SERVER is On it sends the message to the CLIENT
through his own TClientSocket into the CLINT's TServerSocket of his presence.
Sincerely,
Nestorua.

Author

Commented:
Thanks Nestorua, but I need an example.  The client machine does not know the IP address of the server as it could be any PC within the same domain.

Thanks,

MoonCalf.

Commented:
HI, MoonCalf,
When your Server is On, it can send his IP to the CLIENT
through its TClientSocket component to
CLIENT's TServerSocket component.
Sincerely,
Nestorua.

Author

Commented:
Can someone please give me a code example of a client and a server.  They need to be able to be able to connect to each other, within the same domain, regardless of each of their IP addresses.

Thank you,

MoonCalf.

Commented:
Can you install a DNS Server on the NT Machine?
MoonCalf:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

PAQ'd and pts refunded

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
This question is PAQed and no points refunded (of 50)

YensidMod
Community Support Moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.