From mboxrd@z Thu Jan 1 00:00:00 1970 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C70EF8.7D939E28" Date: Thu, 23 Nov 2006 12:11:21 -0000 Message-ID: From: "Daniel Schnell" Subject: [Xenomai-help] RTCAN: multiple sockets on one device List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C70EF8.7D939E28 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, =20 If one opens two sockets to one CAN port and wants to use one socket file descriptor for reading and the other for writing, is it possible to limit the writing socket to _write only_, so it doesn't receive messages ? =20 Background: if using this kind of approach, both sockets will get a copy of the received data. So the writing only socket gets a receive buffer overflow, because it doesn't read the data from the socket. If one could somehow set this socket to a write only state, the buffer overflow would probably not happen. =20 Best regards, =20 Daniel. ------_=_NextPart_001_01C70EF8.7D939E28 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi,
 
If one = opens two=20 sockets to one CAN port and wants to use one socket file descriptor = for=20 reading and the other for writing, is it possible to limit the writing = socket to=20 _write only_, so it doesn't receive messages ?
 
Background: if using=20 this kind of approach, both sockets will get a copy of the received = data. So the=20 writing only socket gets a receive buffer overflow, because it = doesn't=20 read the data from the socket. If one could somehow set this socket to a = write=20 only state, the buffer overflow would probably not = happen.
 
Best=20 regards,
 
Daniel.
------_=_NextPart_001_01C70EF8.7D939E28-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4565C1D7.9060509@domain.hid> Date: Thu, 23 Nov 2006 16:44:23 +0100 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Xenomai-help] RTCAN: multiple sockets on one device References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigD840B092C74853BA6286B67C" Sender: jan.kiszka@domain.hid List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Daniel Schnell Cc: xenomai@xenomai.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigD840B092C74853BA6286B67C Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Daniel Schnell wrote: > Hi, > =20 > If one opens two sockets to one CAN port and wants to use one socket > file descriptor for reading and the other for writing, is it possible t= o > limit the writing socket to _write only_, so it doesn't receive message= s > ? Option 1: Do not bind the socket, use sendto/sendmsg for transmitting (send requires binding). Option 2: Register an impossible filter for the write-only socket. This is suboptimal ATM. Actually we should allow registering an empty filter list for this purpose. This has been recently discussed on the socketcan list, but I'm not aware of any concrete result. Jan --------------enigD840B092C74853BA6286B67C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFZcHXniDOoMHTA+kRAqnhAJwJLLgudval6n8E1UtRMaEHH2cy6wCeNCF8 mO3DHErceyY/BzAn4v4SBwQ= =G2n9 -----END PGP SIGNATURE----- --------------enigD840B092C74853BA6286B67C-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4565CC77.608@domain.hid> Date: Thu, 23 Nov 2006 17:29:43 +0100 From: Wolfgang Grandegger MIME-Version: 1.0 Subject: Re: [Xenomai-help] RTCAN: multiple sockets on one device References: <4565C1D7.9060509@domain.hid> In-Reply-To: <4565C1D7.9060509@domain.hid> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai@xenomai.org Jan Kiszka wrote: > Daniel Schnell wrote: >> Hi, >> >> If one opens two sockets to one CAN port and wants to use one socket >> file descriptor for reading and the other for writing, is it possible to >> limit the writing socket to _write only_, so it doesn't receive messages >> ? Note that the messages are aways received and handled by the ISR. If nobody is waiting on messages defined by the filter definitions, they will be discarded. > Option 1: Do not bind the socket, use sendto/sendmsg for transmitting > (send requires binding). Yes, this will avoid checking one unnecessary filter definition (a bit less overhead). But using just one socket would be fine as well ;-). > Option 2: Register an impossible filter for the write-only socket. This > is suboptimal ATM. Actually we should allow registering an empty filter > list for this purpose. This has been recently discussed on the socketcan > list, but I'm not aware of any concrete result. Oliver answered and liked the idea, but there is no agreement yet. Wolfgang. From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4572F206.8050708@domain.hid> Date: Sun, 03 Dec 2006 16:49:26 +0100 From: Wolfgang Grandegger MIME-Version: 1.0 Subject: Re: [Xenomai-help] RTCAN: multiple sockets on one device References: <4565C1D7.9060509@domain.hid> In-Reply-To: <4565C1D7.9060509@domain.hid> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai@xenomai.org Jan Kiszka wrote: > Daniel Schnell wrote: >> Hi, >> >> If one opens two sockets to one CAN port and wants to use one socket >> file descriptor for reading and the other for writing, is it possible to >> limit the writing socket to _write only_, so it doesn't receive messages >> ? > > Option 1: Do not bind the socket, use sendto/sendmsg for transmitting > (send requires binding). > > Option 2: Register an impossible filter for the write-only socket. This > is suboptimal ATM. Actually we should allow registering an empty filter > list for this purpose. This has been recently discussed on the socketcan > list, but I'm not aware of any concrete result. I have committed an update allowing the registration of an empty filter list. Have a look to the utility program "rtcansend.c" to see how to use it. Wolfgang.