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

Bugfix tcp #120

Closed
wants to merge 5 commits into from
Closed

Bugfix tcp #120

wants to merge 5 commits into from

Conversation

boaks
Copy link
Contributor

@boaks boaks commented Nov 3, 2016

Correct parameter order in TcpServerConnector.
Correct "stop()" to be executable multiple times.

#118

Achim Kraus added 4 commits November 3, 2016 16:55
The order of numberOfThreads and idleTimeout are exchange in
TcpServerConnector. So moving numberOfThreads before idleTimeout will
harmonice the API and fix the "parameter exchange", when
TlsServerConnector calls super.

Signed-off-by: Achim Kraus <achim.kraus@bosch-si.com>
coap+tcp doesn't use the message type, but currently some other code
rely on type being set (e.g. some Message Tracer).

Signed-off-by: Achim Kraus <achim.kraus@bosch-si.com>
If stop is called twice, a NullPointerException is caused by workerGroup
being set to null at the first call. Add synchronize as in UDPConnector.

Signed-off-by: Achim Kraus <achim.kraus@bosch-si.com>
If stop is called twice, a NullPointerException is caused by workerGroup
and bossGroup being set to null at the first call. Add synchronize as in
UDPConnector.

Signed-off-by: Achim Kraus <achim.kraus@bosch-si.com>
@joemag1
Copy link
Contributor

joemag1 commented Nov 3, 2016

Kai, this looks good to me.

Copy link
Contributor

@sophokles73 sophokles73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some minor formatting issues

@@ -106,13 +107,15 @@ public CoapTcpStack(NetworkConfig config, Outbox outbox) {

// delegate to top
@Override public void sendRequest(Request request) {
if (null == request.getType()) request.setType(Type.CON);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put the statement on a new line and in between curly braces

top.sendRequest(request);
// CoAP over TCP does not have acknowledgements. Everything is automatically acknowledged.
request.setAcknowledged(true);
}

// delegate to top
@Override public void sendResponse(Exchange exchange, Response response) {
if (null == response.getType()) response.setType(Type.CON);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please put the statement on a new line and in between curly braces

@@ -26,6 +26,9 @@
@RunWith(Parameterized.class)
public class TcpConnectorTest {

private static final int NUMBER_OF_THREADS = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hell, so californium uses tabs, but connector spaces?

@@ -35,6 +35,8 @@

public class TlsConnectorTest {

private static final int NUMBER_OF_THREADS = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the formatting:
sorry I'm a little lost:

    @Override public void destroy() {
        for (Layer layer : layers)
            layer.destroy();
    }

        @Override public void receiveRequest(Exchange exchange, Request request) {
            // if there is no BlockwiseLayer we still have to set it
            if (exchange.getRequest() == null)
                exchange.setRequest(request);
            if (hasDeliverer()) {
                deliverer.deliverRequest(exchange);
            } else {
                LOGGER.severe("Top of CoAP stack has no deliverer to deliver request");
            }
        }

So, is it OK to correct only my changes, or is more required?

Signed-off-by: Achim Kraus <achim.kraus@bosch-si.com>
@sophokles73
Copy link
Contributor

I would like to squash all of these commits into one since they are all fixing small issues with the TCP support. This will also make it easier to cherry pick it on master. Any objections?

@boaks
Copy link
Contributor Author

boaks commented Nov 4, 2016

OK, from my side.

@sophokles73
Copy link
Contributor

merged

@sophokles73 sophokles73 closed this Nov 4, 2016
@sophokles73 sophokles73 deleted the bugfix_tcp branch March 23, 2017 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants