How to use CommUDP

All except GUI problems
Post Reply
dmaksimiuk
Posts: 28
Joined: Sun Jun 14, 2015 3:56 pm
Location: Delft, The Netherlands

How to use CommUDP

Post 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
User avatar
Ivan Denisov
Posts: 362
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: How to use CommUDP

Post 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;
dmaksimiuk
Posts: 28
Joined: Sun Jun 14, 2015 3:56 pm
Location: Delft, The Netherlands

Re: How to use CommUDP

Post by dmaksimiuk »

Hi Ivan,
Thanks!

Cheers,
Darek
Post Reply