Search found 6 matches
- Mon Jul 05, 2010 9:19 am
- Forum: Internet
- Topic: Messages are read twice from socket
- Replies: 11
- Views: 10578
Re: Messages are read twice from socket
If I understand the accept command right, it opens a new socket. The way I use sockets is to keep them open until the application is finished and not opening an new one for each message to be sent. But your code seems to do that, right? Although I already tried this before, I added "until return" to...
- Fri Jul 02, 2010 2:28 pm
- Forum: Internet
- Topic: Messages are read twice from socket
- Replies: 11
- Views: 10578
Re: Messages are read twice from socket
-you open the socket -a callback message is fired, once the connexion is made -then read the data until a special character is read (here : "#") -then when read is completed (condition of the until "#" is being met), a second message is fired -the second call back message allow you to process the d...
- Fri Jul 02, 2010 1:03 pm
- Forum: Internet
- Topic: Messages are read twice from socket
- Replies: 11
- Views: 10578
Re: Messages are read twice from socket
You should try my solution : one message to be fired when data arrive, and another message once the reading is done. I'm not positive it would solve your problem. But before I've encountered this issue of reading the same data, several times. With the structure I describe, it solved this issue (plu...
- Fri Jul 02, 2010 12:11 pm
- Forum: Internet
- Topic: Messages are read twice from socket
- Replies: 11
- Views: 10578
Re: Messages are read twice from socket
I'm not sure what you mean by differentiate. I don't see why the script would be called twice as the message is supposed to be erased from the socket after reading. Or maybe that assumption is the reason why I do have such problems indentifying the cause of this. Anyway, as I understand the read fro...
- Fri Jul 02, 2010 10:13 am
- Forum: Internet
- Topic: Messages are read twice from socket
- Replies: 11
- Views: 10578
Re: Messages are read twice from socket
Thanks for your reply. I tried adding the wait for messages and it improved things but sometimes the message is still read twice.
I cannot close the socket because I have to check continuesly for new messages which have to be handled. Any other opinions on this topic?
I cannot close the socket because I have to check continuesly for new messages which have to be handled. Any other opinions on this topic?
- Thu Jul 01, 2010 4:09 pm
- Forum: Internet
- Topic: Messages are read twice from socket
- Replies: 11
- Views: 10578
Messages are read twice from socket
Hi everyone, I have a bit of a strange problem and I first have to say that I am not 100 % sure if it is runRev related at all. But anyway, here is what I'm doing: I have a socket connection with runRev as the server and an application written in C++ as the client, using my own protocol. Everything ...