asUDP :  schmittMachine support schmittMachine Support Home
Questions related to the asUDP Xtra 
Support for ByteArray of D11.5?
Posted by: aquastar ()
Date: August 31, 2009 04:15PM

Hello. This xtra is very useful for my project. But now D11.5 also has ByteArray object. Can you make your asUDP to support ByteArray of D11.5? Thanks.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: antoine schmitt ()
Date: August 31, 2009 05:09PM

This is on my ToDo list.... waiting for some time on my hand...

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: aquastar ()
Date: September 01, 2009 09:57AM

If I bought asUDP, would I get the upgraded version? smiling smiley

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: antoine schmitt ()
Date: September 01, 2009 01:48PM

Of course !
I'm against paying upgrades... winking smiley

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: aquastar ()
Date: September 09, 2009 03:13PM

I bought it. smiling smiley

After I tried it, I found it wouldn't report an error when binding failed. And it can't choose which local address to bind if there is more than one. Hope there will be upgrades soon.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: antoine schmitt ()
Date: September 09, 2009 03:37PM

Helo

I'm surprised that it does not report an error when binding fails. Normally it does.. At least it reports all the errors reported by the Windows API.

And about local address, you mean that you have multiple network cards and want to select the one to use to bind ? Indeed, for now, I bind to the default address... Will put this on my todo list.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: aquastar ()
Date: September 10, 2009 05:37AM

I tested it again. When I made 2 asUDP listen to 1 port, they didn't return errors.

There is another question. Does a client need to listen to a port? It can't receive any data after connecting to a server if not listening.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: antoine schmitt ()
Date: September 10, 2009 08:55AM

Hello,

on Mac, I do get an error : "UDP error 'OTBind' ' -3247 The address is in use and is not available for the current function.'"
on Windows, indeed, using an already used port does not return an error (even though it did fail to bind). I'll check if I can do return some error (since Windows API does not). On my todo list.

About listening to a port, yes, this is the way UDP works in general. There is no real notion of 'connection', the basic brick is 'listening' and 'sending'. The basic aspect of UDP is : listening to a port, to which many clients can send. Then if a client wants to receive an answer, it must listen too, to its own port, to which the server will send an answer. This is the basis of the UDP protocol.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: aquastar ()
Date: September 10, 2009 05:29PM

Thank you for answers.

If I startListen and then setSendingPort the same port, will there be 2 bindings? There maybe some problems. I have strange situation like this:

Process 1:
startListen(1422)
setSendingPort(1422)
sendBytes to localhost:1423

Process 2:
startListen(1423)
setSendingPort(1423)
sendBytes to localhost:1422

Process 2 can receive data from Process 1, but Process 1 can't receive data from Process 2. The two process are from the same code. I am doing something like STUN to establish P2P connection but get stuck here.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: antoine schmitt ()
Date: September 11, 2009 09:05AM

NOrmally, there is no problem to bind to the same port for sending and receiving. This is two different bindings.

The problem that you describe is not normal indeed. Thanks for any more info.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: aquastar ()
Date: September 11, 2009 11:29AM

After some experiments I found if I set one port for both sending and receiving, there is 50% chance that it couldn't receive any data. I need to free xtra and recreate it to get another chance. There is no chance before recreating.

If I set different ports, there was no such error.

Can you create one socket for both listening and sending? Or you already do so? I think that can solve the problem.


PS. I am using Director 11.5 and Windows XP.

Options: ReplyQuote
Re: Support for ByteArray of D11.5?
Posted by: antoine schmitt ()
Date: September 11, 2009 01:33PM

Yes, this is a problem on Windows, that I've already encountered. When binding the send port and the receive port to the same port, it says that the bind succeeds, but actually no.
The only solution is to test the connection (sending to oneself), and if this fails, close both the sockets and retry.
Sorry about this, but this is a Windows problem as such.

Options: ReplyQuote


Sorry, only registered users may post in this forum.
This forum powered by Phorum.