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

Dynamically adding frames to a running server is not possible. #8

Open
alex-born opened this issue Jan 22, 2018 · 1 comment
Open

Comments

@alex-born
Copy link
Member

alex-born commented Jan 22, 2018

If anyone can figure this out, it would be greatly appreciated. If we run our server, which I am doing with a test case, you cannot add new Frame objects to the internal frame stack.

Here is the test code (server):

    RobotServer rs = new RobotServer(Constants.PORT, Constants.WAIT_MS);
    Thread server = new Thread(rs);
    server.run();
    for(int i = 0; i <= 100; i++) {
        rs.add(new AmpFrame(new LocalTimestamp(), 11.23));
    }
    rs.setmIsRunning(false);

Here is the test code (janky test client):

    int PORT = 5800;
    try(
        Socket server = new Socket("localhost", PORT);
        BufferedReader in = new BufferedReader(new InputStreamReader(server.getInputStream()));
    ){
        String fromServer;
        while(server.isConnected()){
            fromServer = in.readLine();
            if(fromServer != null){
                System.out.print(fromServer);
                System.out.print("\n");
            }
        }
    }catch(Exception e){
        e.printStackTrace();
        System.exit(1);
    }

All the server code is in robot.io.server.* (on the client-server branch)

@alex-born alex-born changed the title You cannot dynamically add frames to a running server. Dynamically adding frames to a running server. Jan 22, 2018
@alex-born alex-born changed the title Dynamically adding frames to a running server. Dynamically adding frames to a running server is not possible. Jan 22, 2018
@nprisbrey
Copy link
Member

Is this issue solved? Can it be closed now? @alex-born

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants