Experimenting with #sendUDPData:toHost:port:

John M McIntosh johnmci at smalltalkconsulting.com
Wed Dec 13 17:28:56 UTC 2000


>I came around another issue, which I recall was also reported by the
>original poster: the prinmitive
>
>SocketPlugin>>primitiveSocketSendUDPDataBufCount
>
>fails with a 'connection refused' errno when the server specified is not
>up. Is this intended behavior for UDP sockets? If so, how would I
>actually avoid primitiveFailed to be signalled, i.e. is there a way to
>ensure the address's availability beforehand? In my application I'd like
>to send some UDP data and simply do nothing if the packet fails to be
>delivered.
>
>TIA
><sk>

Well I can say we've never really sat down and documented the failure 
cases for each of the socket primitive calls. So passing 
bad/bogus/illegal data and/or talking to non-existent clients hasn't 
been fully tested.

However I would have expected that sending a UDP packet to a 
non-existent host should not give you a primitive failure. This type 
of protocol has no guaranteed delivery built in so the fact the other 
side doesn't see your packets should not be a concern for you.

Many of the socket primitives can throw primitive failures if they 
are given bad  parms, or if they think there is some serious issue, 
you would need to look at the code to see what decisions they make. 
In a critical situation you should have exception handlers to catch 
errors, then log and recover.
-- 
--
===========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================
Custom Macintosh programming & various Smalltalk dialects
PGP Key: DSS/Diff/46FC3BE6
Fingerprint=B22F 7D67 92B7 5D52 72D7  E94A EE69 2D21 46FC 3BE6
===========================================================================





More information about the Squeak-dev mailing list