realbasic-nug
[Top] [All Lists]

UDPSocket Error 54

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: UDPSocket Error 54
From: "Daniel L. Taylor" <dtaylor@taylor-design.com>
Date: Thu, 28 May 2009 20:04:52 -0700
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; domainkeys=hardfail header.From=dtaylor@taylor-design.com
Delivered-to: listarchive@realsoftware.com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; h=X-Originating-IP:Message-ID:Date:From:Reply-To:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; s=default; d=taylor-design.com; b=dl11vrcXnnJbjSeZrhj0sqXcbFd+osp3GajltnlodvhA/UxsWaKdAu0NiO4STphqIXUqLVsgDLHcW01dU4Zv9sTKj+by+lvB5FIHbFQSZwBA0Cb+8e9xWi2dK2QxpyMvKmgGA6dKZ2WbLlg5gO7l/mu1m81VFzej9fhHrIMbYI4=;
Domainkey-status: bad
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
I have a setup where a server opens a UDPSocket so that clients can use UDP to broadcast requests for various little bits of information.

Works great except that using RB2009r2.1 the socket on the server disconnects with an error code of 54 after sending a reply. As a work around I've found that I can get the socket back up by calling Close and then Connect right in the Error event. So practically, for the moment, this problem is not interrupting the service. But I don't care for leaving it like this. I would like to know what the error is.

Playing around I also discovered that if I place a delay in the client method which reads the returned Datagram this problem goes away. By delay I mean loop until 1000 microseconds go by. That's it.

This method is not being called from a thread, but the delay fix leaves me wondering if some internal RB buffer or code just needs a chance to do some cleanup? I didn't try DoEvents but maybe that would work as well?

While I'm at it...my understanding of UDP is that I would not use a ServerSocket for this task like one would with a TCP service. For the server I should just have one socket connected to a port and replying to datagrams broadcast around the network on said port, correct?

--

Daniel L. Taylor
Taylor Design
Computer Consulting & Software Development
dtaylor@taylor-design.com
www.taylor-design.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>