Page 1 of 1

How to use CommUDP

Posted: Mon Oct 19, 2015 3:10 pm
by dmaksimiuk
Hi All,
For time being I have decided to go back to BBox v.1.6.
I got the ypkCommUDP subsytem compiled. I tried to modify sources of modules CommObxStreamsClient and CommObxStreamsServer and I have the
protocol "CommTCP" replaced with "CommUDP". Probably this is not right way to so. Is there any working example that uses ypkCommUDP subsystem?

Cheers,
Darek

Re: How to use CommUDP

Posted: Mon Oct 19, 2015 4:54 pm
by Ivan Denisov
I am also get a lot of open windows while using CommObxStreamsClient and CommObxStreamsServer.

Peter said that the example of usage is MsgCommExt.
https://bitbucket.org/petryxa/msg

Code: Select all

	PROCEDURE (a: InitAction) Do;
		CONST 
			proto = 'ypkCommUDP';
			localInAdr = '0.0.0.0:'+port;
			localOutAdr = '0.0.0.0:0';
			remoteAdr = '255.255.255.255:'+port;
		VAR l: CommStreams.Listener; out, in: CommStreams.Stream; res: INTEGER; im: InitMsg;
	BEGIN
		CommStreams.NewListener(proto, localInAdr, l, res);
		IF res=0 THEN
			l.Accept(in);
			CommStreams.NewStream(proto, localOutAdr, remoteAdr, out, res);
			IF res=0 THEN
				im.in:=in; im.out:=out;
				a.owner.Handle(im);
			ELSE 
				a.owner.Error(res);
			END;
		ELSE 
			a.owner.Error(res);
		END;
	END Do;

Re: How to use CommUDP

Posted: Mon Oct 19, 2015 5:25 pm
by dmaksimiuk
Hi Ivan,
Thanks!

Cheers,
Darek