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: Sun, 28 Mar 2004 18:15:11 +0200
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.