Exemplo n.º 1
0
        public void BroadUdpCast(string roomId, NotifyType notifyType, BaseInfo sendInfo, string ownerId)
        {
            List <UserInfo> users = Users.GetInstance().GetRoomUsers(roomId);

            for (int i = 0; i < users.Count; i++)
            {
                int port = users[i].UdpPort;

                if (users[i].Id != ownerId)
                {
                    UdpServerClient.GetInstance().Send(users[i].Socket, users[i].OpenPortes, notifyType, sendInfo);
                }
            }
        }
Exemplo n.º 2
0
        public static IServerClient CreateClient(IServerListener listeners, Protocols?proto)
        {
            IServerClient sc = null;

            switch (proto)
            {
            case (Protocols.Tcp):
            {
                sc = new TcpServerClient(listeners.GetClientSocket());
                break;
            }

            case (Protocols.Udp):
            {
                sc = new UdpServerClient(listeners.GetClientSocket());
                break;
            }
            }

            return(sc);
        }