Re: networking mac to pc using...
Re: networking mac to pc using...
- Subject: Re: networking mac to pc using...
- From: Frederick Cheung <email@hidden>
- Date: Mon, 29 Mar 2004 01:35:44 +0200
On 29 Mar 2004, at 00:58, Michael Short wrote:
OK, that sounds good, will it allow the sending of a message from the
client to a server without a defined location or address? so the
client sends some sort of global message which the server listens for
and then reply's with its locate to the client??
No, but you can send udp packets to the broadcast address although I
have never needed to do that so I can't give you any pointers there.
You might want to look into rendezvous, using is dead easy on the mac
side, on the pc side you would have to take a look at apple's open
source implementation of it.
Fred
Michael
On 28 Mar 2004, at 18:15, Frederick Cheung wrote:
To: email@hidden
From: Michael Short <email@hidden>
Subject: networking mac to pc using...
Date: Sat, 27 Mar 2004 16:28:26 +0100
Hello
I am trying to create a little client server system. The client once
on
the network has to find and server and then connect etc. This server
maybe running on a windows or macosx system and therefore cannot use
a
mac only system.
I have not worked very much with network programming so any help in
this area would be great.
I was think of a situation like a mac client is connect to a network
wire or not. It then sends out a message across the network which the
windows server version is listen for and then replies to the source
of
the message, the client, with the needed information to make a more
permanent connection.
how would | go about this?
On the PC side, you will be using the WinSock API, which as its name
indicates is a sockets type api.
On the Mac side, you will either be using OpenTransport, or BSD
sockets. If you need OS 9 compatibility you will have to use
OpenTransport on the mac side, if not I would reccomend that you use
the BSD sockets, as Open Transport is only really a compatibility
layer on OS X.
You should be able to find many sockets tutorials on the net, but
basically, on the client side you use
socket() to create your socket
connect() to attempt a connection to a remote host
if this succeeds read/write to transfer data, using select() to wait
for data
close() to close the connection
On the server side:
socket() to create the socket
bind() to bind it to a specific port
listen() to indicatre you are interested in incoming connections
select() to wait for an incoming connection
accept() to actually accept it
if this succeeds read/write to transfer data, using select() to wait
for data
close() to close the connection
Fred
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.