-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(istream): implement TCP using ofxTCPServer
the ofxNetwork API is actually quite hard to use (as the API) but since it is simplified, we are using it anyway
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3190114
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this may do unexpected things if more than one client connects and sends data at once. I'm not really sure what the right behavior is in that situation, though. To start, maybe it's fine to just say that the behavior is unexpected if more than one client connects.
3190114
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I was thinking that we should restrict it to a single client but couldn't find the API from ofxNetwork. Later I thought we could limit the loop
for (int i = 0; i < server_.getLastID(); i++)
but the flexibility of stopping the client and reconnecting seems crucial for prototyping (iteration). And for the next connection, you get a different client ID.In the end I simply leave this as is and yes, when multiple clients connect, data will simply be merged and it's undefined behavior.