Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(istream): implement TCP using ofxTCPServer #364

Merged
merged 3 commits into from
Sep 10, 2016
Merged

Conversation

nebgnahz
Copy link
Collaborator

@nebgnahz nebgnahz commented Sep 8, 2016

tested with netcat and I can manually insert data point through tcp connections

nebgnahz and others added 3 commits September 8, 2016 14:01
the ofxNetwork API is actually quite hard to use (as the API) but since
it is simplified, we are using it anyway
so that synchronization between threads (main thread and data reading
thread) is easier.
@damellis
Copy link
Owner

damellis commented Sep 9, 2016

Also, it looks like there's no explicit splitting of the input data into lines (e.g. based on newlines). That seems like it would cause problems if the client sends more or less than exactly one line of data at a time.

But maybe I'm misreading this?

@nebgnahz
Copy link
Collaborator Author

nebgnahz commented Sep 9, 2016

To be frank, I don't know what happens at those cases. This magic function setMessageDelimiter seems to be handling the line separation but I cannot judge much from the documentation (http://openframeworks.cc/documentation/ofxNetwork/ofxTCPClient/#show_setMessageDelimiter).

edit: I think if the message doesn't have line breaks, then the receive won't get back the data. If the message have one more line breaks, the worst case is dropping package (probably not a big deal..., but we can improve).

@damellis
Copy link
Owner

damellis commented Sep 9, 2016

Whoops, sorry, I did miss the call to setMessageDelimiter()... That sounds like it probably does the right thing, but you're right, we may want to do some tests to make sure.

@nebgnahz nebgnahz merged commit e0901ab into master Sep 10, 2016
@nebgnahz nebgnahz deleted the tcp-input-stream branch September 10, 2016 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants