public void Send <T>(int csId, T value) { if (csId < 0) { throw new Exception("Negative ids are reserved for SocketFlow"); } var wrapper = flowBinder.GetWrapper <T>(); protocol.Send(csId, wrapper.DataWrapper.FormatObject(value)); }
public void GetWrapper_OneWrapper_ShouldBeReturnCorrectWrapper() { Action <Planet> action = Console.WriteLine; var wrapper = new JsonDataWrapper <Planet>(); binder.Using(wrapper); binder.Bind <Planet>(1, action); var actualWrapperInfo = binder.GetWrapper(1); Assert.AreEqual(typeof(Planet), actualWrapperInfo.Type); Assert.AreEqual(wrapper, actualWrapperInfo.DataWrapper); }
internal byte[] GetData <T>(T value) { var wrapper = flowBinder.GetWrapper <T>(); return(wrapper.DataWrapper.FormatObject(value)); }