public void SetupServer() { Log.LogManager.Level = Log.LogLevel.Fatal; CoapConfig config = new CoapConfig(); config.Deduplicator = "MarkAndSweep"; config.MarkAndSweepInterval = TEST_SWEEP_DEDUPLICATOR_INTERVAL; config.ExchangeLifetime = TEST_EXCHANGE_LIFETIME; config.MaxMessageSize = TEST_BLOCK_SIZE; config.DefaultBlockSize = TEST_BLOCK_SIZE; // Create the endpoint for the server and create surveillant _serverEndpoint = new CoAPEndPoint(config); _serverSurveillant = new EndpointSurveillant("server", _serverEndpoint); _clientEndpoint = new CoAPEndPoint(config); _clientEndpoint.Start(); _clientSurveillant = new EndpointSurveillant("client", _clientEndpoint); // Create a server with two resources: one that sends piggy-backed // responses and one that sends separate responses _server = new CoapServer(config); _server.AddEndPoint(_serverEndpoint); TestResource piggyRes = new TestResource(PIGGY, Mode.PiggyBacked); TestResource separateRes = new TestResource(SEPARATE, Mode.Separate); _server.Add(piggyRes); _server.Add(separateRes); _server.Start(); _serverPort = ((System.Net.IPEndPoint)_serverEndpoint.LocalEndPoint).Port; _timer = new Timer(o => { piggyRes.Fire(); separateRes.Fire(); }, null, 0, OBS_NOTIFICATION_INTERVALL); }