-----Original Message----- From: linux-bluetooth-owner@xxxxxxxxxxxxxxx [mailto:linux-bluetooth-owner@xxxxxxxxxxxxxxx] On Behalf Of Hendrik Sattler Sent: 2011年6月22日 19:18 To: Luiz Augusto von Dentz Cc: Li, Nami; Piotr Zgórecki; linux-bluetooth@xxxxxxxxxxxxxxx; Liu, Haijun; Fan, Hong Subject: Re: SRM support in OBEX Zitat von Luiz Augusto von Dentz <luiz.dentz@xxxxxxxxx>: > Hi Nami, > > 2011/6/22 Li, Nami <nami@xxxxxxxxxxxxxxxx>: >> Hi, Piotr >> I worked on SRM several weeks ago but finally stopped. >> It`s easy to set and check SRM header, as well as set the response >> mode to OBEX_RSP_MODE_SINGLE. And it is already well supported in >> obex_work function when the response mode is SRM, client and server >> can continue send data without remote side response or request. The >> obex_work callback relationship is: >> obex_session_start() >> ... >> g_io_add_watch_full(io, G_PRIORITY_DEFAULT, >> G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL, >> obex_handle_input, obex, obex_handle_destroy); >> ... >> obex_handle_input() >> ... >> OBEX_HandleInput(obex, 1) >> ... >> OBEX_HandleInput() >> ... >> obex_work(self, timeout); >> >> The problem in SRM is: >> If remote side doesn`t send any data to local side, then the G_IO_IN >> condition couldn`t be set. So how obex_work can be called? >> >> I haven`t found any good solution for this issue. So if you can spend >> some time on SRM, I`ll be very happy:) > > No top posting in this list, please. > > So back to the topic, we probably need to add another watch with > G_IO_OUT when using SRM so that it wake ups whenever we can write to > the socket/fd, obviously this should only be active when we are > sending data (GET) and there is no need to call OBEX_HandleInput. You have to call OBEX_HandleInput() for sure. It does the work also for the SRM case. I am also redesigning the state machine in OpenOBEX so that incomplete writes on non-blocking sockets are possible. This feature will be protected by a flag because it creates a small problem like for SRM. If you need a function in OpenOBEX that tells you if input-independent writes are needed, just tell me or create one :-) HS What do you mean "incomplete writes on non-blocking sockets " and " input-independent writes "? Do you mean to write lots of data one time and use G_IO_OUT to wakeup obex_work? Regards, Nami -- ��.n��������+%������w��{.n�����{����^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�