471,342 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,342 software developers and data experts.

Flushing of the tcp socket

Hi to all,

I would like to flush the datas in a tcp socket connection, however in the package socket I haven't found any function to do this work. I was thinking of opening and closing the socket each time I need a flush, but this doesn't seem to me the perfect solution. Do you have anything to suggest? Thanks in advance

Regards,
Daniele
Jun 12 '07 #1
3 3307
ghostdog74
511 Expert 256MB
AFAIK, you don't need to flush a socket.
Jun 12 '07 #2
AFAIK, you don't need to flush a socket.
I'll explain better my situation: I want to receive, for example, only 10 bytes, but the device I have on the other side of the connection sends me 20 bytes. If I take only 10 bytes when I do the next receive I don't get the new 10 bytes, but the previous ones sent by the device which were part of the group of 20 bytes sent the first time.

I would like to use a flush, because when I read the first 10 bytes I can then discard the remaining 10.
Jun 12 '07 #3
ghostdog74
511 Expert 256MB
I'll explain better my situation: I want to receive, for example, only 10 bytes, but the device I have on the other side of the connection sends me 20 bytes. If I take only 10 bytes when I do the next receive I don't get the new 10 bytes, but the previous ones sent by the device which were part of the group of 20 bytes sent the first time.

I would like to use a flush, because when I read the first 10 bytes I can then discard the remaining 10.
hmm...without looking at your code, i can only guess :) the read() method can take in number of bytes read. maybe you want to try that. or else the other good ppl here can help you later..
Jun 12 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Graham Ashton | last post: by
6 posts views Thread by Farshid Lashkari | last post: by
3 posts views Thread by gf gf | last post: by
5 posts views Thread by Christopher Benson-Manica | last post: by
4 posts views Thread by Stephan Steiner | last post: by
1 post views Thread by amitk12 | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.