本文整理汇总了C#中Connection.flush方法的典型用法代码示例。如果您正苦于以下问题:C# Connection.flush方法的具体用法?C# Connection.flush怎么用?C# Connection.flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection.flush方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: requestControl
public static void requestControl(game.Vessel vessel, game.FlightControl c, Connection connection)
{
connection.stream.write("control");
vessel.serialize(connection.stream);
c.serialize(connection.stream);
connection.flush();
c.deserialize(connection.stream);
}
示例2: requestGui
public static List<Window> requestGui(Connection connection, Window.OnUpdate onUpdate)
{
connection.stream.write("gui");
connection.flush();
List<Window> windows = new List<gui.Window>();
int size = connection.stream.readInt();
for(int i=0;i<size;i++)
{
Window newWindow = new Window();
newWindow.deserialize(connection.stream);
newWindow.onUpdate = onUpdate;
windows.Add(newWindow);
}
return windows;
}
示例3: requestSetup
public static DebugSettings requestSetup(Connection connection, Screen screen)
{
connection.stream.write("setup");
screen.serialize(connection.stream);
connection.flush();
DebugSettings settings = new DebugSettings();
settings.deserialize(connection.stream);
return settings;
}
示例4: requestGuiUpdate
public static void requestGuiUpdate(List<Window> windows, Connection connection)
{
connection.stream.write("guiUpdate");
connection.stream.write(windows.Count);
foreach(var window in windows)
window.serializeState(connection.stream);
connection.flush();
}
示例5: requestWindowUpdate
public static void requestWindowUpdate(Window window, Connection connection)
{
connection.stream.write("guiWindowUpdate");
connection.stream.write(window.id);
window.views.serializeState(connection.stream);
connection.flush();
}
示例6: requestUpdate
public static void requestUpdate(game.Universe universe, game.Vessel vessel, Connection connection)
{
connection.stream.write("update");
universe.serialize(connection.stream);
vessel.serialize(connection.stream);
connection.flush();
}