示例#1
0
 public RawSocket(AddressFamily family, SocketProvider provider)
 {
     m_rawsock = new Socket(family, SocketType.Raw, ProtocolType.IP);
     m_rawsock.Blocking = false;
     m_Provider = provider;
     m_ReceivedData = new AsyncCallback(OnReceive);
 }
示例#2
0
        public JsonRpcTests()
        {
            var sockets    = SocketProvider.CreateSockets().Result;
            var clientSock = sockets.Item1;
            var serverSock = sockets.Item2;

            Client = new JsonRpcEndpoint(clientSock.GetStream(), JsonRpcEndpoint.EndpointMode.Client);
            Server = new JsonRpcEndpoint(serverSock.GetStream(), JsonRpcEndpoint.EndpointMode.Server);
        }
        public TestClientFixture()
        {
            var sockets    = SocketProvider.CreateSockets().Result;
            var clientSock = sockets.Item1;
            var serverSock = sockets.Item2;

            Service = new RpcService <ITestService>(
                new NetworkRpcService(new TcpTransportLayer(serverSock)
                                      ));
            Caller = new RpcCaller <ITestService>(
                new NetworkRpcClient(new TcpTransportLayer(clientSock)
                                     ));
            Service.Export(new TestService());
            Client = Caller.CreateClient();
        }
示例#4
0
        /// <summary>
        /// Initialize all settings safety.
        /// </summary>
        static Settings()
        {
            GameWindowWidth    = 1280;
            GameWindowHeight   = 800;
            GameZoom           = 2.0F;
            TileSize           = 16;
            GameWindowWidth    = (int)(Math.Ceiling(((double)GameWindowWidth / TileSize)) * TileSize);
            GameWindowHeight   = (int)(Math.Ceiling(((double)GameWindowHeight / TileSize)) * TileSize);
            GameWindowRealSize = new Vector2(GameWindowWidth / GameZoom, GameWindowHeight / GameZoom);
            TilesHorizontally  = (int)GameWindowRealSize.X / TileSize;
            TilesVertically    = (int)GameWindowRealSize.Y / TileSize;

            // All input text allowed keys(including shift etc...)
            AllowedKeysInput = new Keys[]
            {
                Keys.A, Keys.B, Keys.C, Keys.D, Keys.E, Keys.F, Keys.G, Keys.H, Keys.I, Keys.J, Keys.K, Keys.L,
                Keys.M, Keys.N, Keys.O, Keys.P, Keys.Q, Keys.R, Keys.S, Keys.T, Keys.U, Keys.V, Keys.W, Keys.X,
                Keys.Y, Keys.Z, Keys.OemMinus, Keys.OemPlus, Keys.Back, Keys.Space, Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5, Keys.D6,
                Keys.D7, Keys.D8, Keys.D9, Keys.D0
            };

            UpperKeysInput = new Keys[]
            {
                Keys.LeftShift, Keys.RightShift
            };

            NumbersKeysInput = new Keys[]
            {
                Keys.D1, Keys.D2, Keys.D3, Keys.D4, Keys.D5, Keys.D6, Keys.D7, Keys.D8, Keys.D9, Keys.D0
            };

            // Socket server
            Socket = new SocketProvider();

            // Servers url
            ServerWebUri     = "http://localhost/sixteenbox/";
            ServerSocketUri  = "ws://127.0.0.1:2222/";
            SocketSeparators = new string[] { "[[", "]]" };

            // Server paths
            Paths = new ServerWebUri[]
            {
                new ServerWebUri()
                {
                    FileName = "security.php", Posts = "u={0}&p={1}"
                }
            };
        }
示例#5
0
        static table1col1Controller()
        {
            //for (int i = 0; i < limit; i++) store.Add(i, Guid.NewGuid().ToString());

            try {
                _socket = SocketProvider.init("ws://localhost:56049/message");
                _socket.Send(Guid.NewGuid().ToString());
            }
            catch { }

            try
            {
                _log = LogProvider.init();
                _log.Write(Guid.NewGuid().ToString());
            }
            catch { }

            //try
            //{
            //    _cache = CacheFindProvider.init();
            //    mCacheReply response = _cache.Find(new oCacheFind() {  });
            //}
            //catch { }
        }