From: "Collin R. Mulliner" <collin@betaversion.net>
To: Paolino paperino <vonzoltan@yahoo.it>
Cc: BlueZ Mailing List <bluez-users@lists.sourceforge.net>
Subject: Re: [Bluez-users] [ECONNRESET]Problem with last buffer readed with a read or recv
Date: Wed, 20 Oct 2004 21:15:41 +0200 [thread overview]
Message-ID: <1098299741.4176b95d95447@admin.betaversion.net> (raw)
In-Reply-To: <1098288811.13853.30.camel@pegasus>
Hi,
I have a pretty good documented/commented application that does RFCOMM
client-server communication (client and server implemented in the applica=
tion).
Maybe you should just take a look at my code (it is really not just hacke=
d
stuff!). There is one file with all the RFCOMM stuff in.
http://mulliner.org/bluetooth/btchat/ (you want: btchatd)
... Collin
Quoting Marcel Holtmann <marcel@holtmann.org>:
> Hi Andrea,
>
> > I writed a RFCOMM cleint side socket and its servere
> > side. The server sends an arbitrary sequence of 2048
> > bytes throught the write function. The client side
> > read as far as it receive a 0 or -1 frem the read.
> > The code is like this:
> > char *buffer[2048];
> > do {
> > tmpPtr +=3D nread;
> > nread =3D recv(fd, buffer, length, 0);
> > } while (nread > 0);
> >
> > The problem arise when the server correctly send its
> > last bucket, the client must read it (read 2048
> > bytes), at the next read the client must get an EOF
> > (0) value from the recv...but this not happen it
> > receive -1 and errno=3DECONNRESET. The same code works
> > as expected using TCP streams, but when it is used
> > over RFCOMM SOCK_STREAM it causes this anomaly.
> >
> > Somebody could explain what happens, why the recv call
> > doesn't return a 0 when last data are reached on the
> > stream, but give an error message?
>
> are you sure that your client/server code is correct, because until you
> don't close the socket on the server side, the client can't receive any
> additional information. It simply blocks. Show us the full code for bot=
h
> sides.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJourna=
l
> Use IT products in your business? Tell us what you think of them. Give =
us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out =
more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
next prev parent reply other threads:[~2004-10-20 19:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-20 14:01 [Bluez-users] [ECONNRESET]Problem with last buffer readed with a read or recv Paolino paperino
2004-10-20 16:13 ` Marcel Holtmann
2004-10-20 19:15 ` Collin R. Mulliner [this message]
2004-10-22 8:03 ` Paolino paperino
2004-10-22 11:07 ` Marcel Holtmann
2004-10-22 15:13 ` Paolino paperino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1098299741.4176b95d95447@admin.betaversion.net \
--to=collin@betaversion.net \
--cc=bluez-users@lists.sourceforge.net \
--cc=vonzoltan@yahoo.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox