• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: networking mac to pc using...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: networking mac to pc using...


  • Subject: Re: networking mac to pc using...
  • From: Michael Short <email@hidden>
  • Date: Mon, 29 Mar 2004 00:58:15 +0200

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??

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.


  • Follow-Ups:
    • Re: networking mac to pc using...
      • From: Frederick Cheung <email@hidden>
References: 
 >Re: networking mac to pc using... (From: Frederick Cheung <email@hidden>)

  • Prev by Date: Re: networking mac to pc using...
  • Next by Date: Re: networking mac to pc using...
  • Previous by thread: Re: networking mac to pc using...
  • Next by thread: Re: networking mac to pc using...
  • Index(es):
    • Date
    • Thread