private void SetupNegotiation() { var featureNegotiation = new FeatureNegotiationHandler(this); featureNegotiation.OnAuthenticated += packet => { Stream.Restart(); return packet; }; featureNegotiation.OnResourceBinding += packet => { var disco = new Disco(this); disco.Discover(); return packet; }; featureNegotiation.RegisterForNegotiation(); }