当前位置: 首页>>代码示例>>C#>>正文


C# Connection.flush方法代码示例

本文整理汇总了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);
        }
开发者ID:sopindm,项目名称:CodeSamples,代码行数:9,代码来源:Protocol.cs

示例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;
        }
开发者ID:sopindm,项目名称:CodeSamples,代码行数:21,代码来源:Protocol.cs

示例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;
        }
开发者ID:sopindm,项目名称:CodeSamples,代码行数:11,代码来源:Protocol.cs

示例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();
        }
开发者ID:sopindm,项目名称:CodeSamples,代码行数:10,代码来源:Protocol.cs

示例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();
        }
开发者ID:sopindm,项目名称:CodeSamples,代码行数:9,代码来源:Protocol.cs

示例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();
        }
开发者ID:sopindm,项目名称:CodeSamples,代码行数:9,代码来源:Protocol.cs


注:本文中的Connection.flush方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。