Re: UDP endpoints
Re: UDP endpoints
- Subject: Re: UDP endpoints
- From: Michael Paluszek <email@hidden>
- Date: Tue, 09 Jul 2002 14:33:12 -0400
The notifier is used with asynchronous endpoints. You attach a notifier to
an endpoint. When data is received (or other action happens) the notifier
can peform the appropriate action, like collect the data. The alternative is
to use threads but that would require that Matlab support threads in MEX
files.
When I install the notifier for an endpoint I store the index to the
endpoint (from an array of endpoints.) When the notifier detects incoming
data it passes the index to a read function that reads the data from the
endpoint.
Once you initialize OT it stays initialized until you disable OT. You can
store the endpoints globally to access them from different C functions.
Sincerely,
Mike
-------
Michael A. Paluszek
Princeton Satellite Systems, Inc.
33 Witherspoon Street
Princeton, New Jersey 08542-3207
USA
Telephone: (609) 279-9606
Fax: (609) 279-9607
URL:
http://www.psatellite.com
>
From: mike yurick <email@hidden>
>
Date: Tue, 09 Jul 2002 14:11:39 -0400
>
To: <email@hidden>
>
Subject: UDP endpoints
>
>
Hi everybody,
>
>
I have a few problems. I'm writing a program in a very high-level,
>
interpreted language (MATLAB for Mac to be precise) and I need
>
communications facilities which this language doesn't provide. It DOES let
>
me call C functions at runtime though, so I'm trying to use OT to establish
>
communications with a UNIX machine. I'm using UDP packets to send commands
>
from the UNIX machine to the Mac, and the program receives this info via one
>
of these C function calls. Essentially, it just loops, checking for a new
>
command at the beginning of each iteration and then performs the appropriate
>
operations. The communication that has to take pIace is really simple. I
>
was just going to write a C function that checks a UDP endpoint with OTLook
>
to see if there's any info there waiting and then return the data if its
>
there or some other value if it isnt, but the documentation I've read
>
recommends that I use a notifier function. Why? Also, if I initialize OT
>
in one isolated C function call at runtime, will I be able to make
>
subsequent OT calls in other isolated C function calls as long as I haven't
>
shut it down anywhere? And do endpoints remain bound to an ip/port across
>
calls like this? Also, due to the way this language operates, I don't think
>
it will be possible to pass around endpoint references from one C function
>
to the main program and then back to another C function, so I was wondering
>
if there is any way to open a UDP endpoint on an ip/port and then check the
>
ip/port for info without the endpoint reference? Or is there someway for me
>
to get the enpoint reference that is bound to an ip/port? I'm sorry if
>
these questions are too general or confusing due to my somewhat remedial
>
understanding of OT and network programming in general, but I'd appreciate
>
any insight on the situation.
>
>
Thanks,
>
>
-mike
>
_______________________________________________
>
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.