Linux bluetooth development
 help / color / mirror / Atom feed
* [Bluez-devel] Reading data on two l2cap sockets
@ 2006-08-01 11:11 Mayank BATRA
  2006-08-01 11:32 ` Filippo Giunchedi
  0 siblings, 1 reply; 3+ messages in thread
From: Mayank BATRA @ 2006-08-01 11:11 UTC (permalink / raw)
  To: BlueZ development

Hi,

I am listening on two l2cap sockets (on different PSMs) and then connecting to these two sockets.
I am using select() to get data on these two sockets.

fd_set readfds;
FD_ZERO(&readfds);
FD_SET(sk1, &readfds);
FD_SET(sk2, &readfds);

while(1) {
	int ready = select(FD_SETSIZE, &readfds, 0, 0, 0);
	if(ready == 0)
		continue;
	if(ready == -1 && errno != EINTR)
		break;
	if(FD_ISSET(sk1, &readfds)) {
		fprintf(stderr, "Got something on sk1\n");
		/* some code */
	}
	if(FD_ISSET(sk2, &readfds)) {
		fprintf(stderr, "Got something on sk2\n");
		/* some code */
	}
}

Now, if I send data on sk1, the line "Got something on sk1" is printed, but if I send data on sk2, the line "Got something on sk2" is never printed.
Is there any contraint that both the l2cap sockets should be on the same PSM?

Regards,
Mayank


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-01 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-01 11:11 [Bluez-devel] Reading data on two l2cap sockets Mayank BATRA
2006-08-01 11:32 ` Filippo Giunchedi
2006-08-01 11:56   ` Mayank BATRA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox