• 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: Trying to send data to PC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trying to send data to PC


  • Subject: Re: Trying to send data to PC
  • From: Daniel Veneros <email@hidden>
  • Date: Wed, 16 Dec 2009 23:10:11 -0400

thank you for your answers...
I've already implemented Bonjour on both computers, the windows side publishes the service, and the mac side finds it and resolves the address.
Now, the thing is that I'm using cocoaAsyncSocket and I think it is ready to connect to the other side but I don't know how to create a "listening socket" on the windows side so I can connect with it, and also how to make a "receive" method for that socket so it receives the 7-digit int I need to send.
Anyone knows how to do this... or maybe has an example?
Thanks again

Dann


On Mon, Dec 14, 2009 at 9:59 AM, Kenny Millar <email@hidden> wrote:
Also bear in mind, that if your are using a G4/G5 Mac then the processors
are not of the same design, with the PC being little endian and the G4/G5
being big endian, so you'd need to do some byte swapping with the data.

On the windows PC you can use Windows Sockets (winsock) or if you're a fan
of the Microsoft Foundation Classes (MFC) look at CSocket and CAsyncSocket.

Windows by default knows didley-squat about Bonjour and has no APIs for
listening for bonjour services etc, so it's easier to make the PC the
'server' which 'listens' for a connection from the Mac, and make the Mac the
Client which connects to the PC.

-Kenny M.

-----Original Message-----
From: macnetworkprog-bounces+kennymillar=mac.com@lists.apple.com
[mailto:macnetworkprog-bounces+kennymillar=mac.com@lists.apple.com] On
Behalf Of Quinn
Sent: 14 December 2009 09:28
To: email@hidden
Subject: Re: Trying to send data to PC

At 21:32 -0400 13/12/09, Daniel Veneros wrote:
>Does anyone knows how can I connect both pplatforms using sockets?

On the Mac side you can use a variety of different networking APIs.
The one I generally recommend is NSStreams, as illustrated by the
SimpleNetworkStreams sample.  Alternatively, you can use the standard
BSD sockets API.

<http://developer.apple.com/iPhone/library/samplecode/SimpleNetworkStreams/i
ndex.html
>

On the Windows side... well, let's just say I'm not enough of a
Windows expert to offer you specific advice about Windows programming.

Ultimately this is going to boil down to one of the machines opening
a listening socket and registering it as a Bonjour service.  The
other machine then browses for services, resolves the appropriate
one, and connects to it.  At this point the server side accepts the
connection and communication can proceed.

S+E
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Trying to send data to PC
      • From: Jens Alfke <email@hidden>
References: 
 >Trying to send data to PC (From: Daniel Veneros <email@hidden>)
 >RE: Trying to send data to PC (From: Kenny Millar <email@hidden>)

  • Prev by Date: Re: [MacNetwork] Verifying Certificates ... on the iPhone?
  • Next by Date: Re: Trying to send data to PC
  • Previous by thread: RE: Trying to send data to PC
  • Next by thread: Re: Trying to send data to PC
  • Index(es):
    • Date
    • Thread