Exemple #1
0
        public void Start()
        {
            // pass port number

            ChannelGroupSettings settings = new ChannelGroupSettings();

            settings.MakeChannel(new Channel(1024, "textchannel", ChannelPriority.HIGH, ChannelMessageTypes.TEXT));
            settings.MakeChannel(new Channel(1024, "fileschannel", ChannelPriority.HIGH, ChannelMessageTypes.BINARY));
            settings.MakeChannel(new Channel(1024, "jsonchannel", ChannelPriority.HIGH, ChannelMessageTypes.JSON));

            Connection.WebSocketServer wss = new Connection.WebSocketServer(settings);

            wss.LostConnection        += new MessageEventHandler(this.OnClosedConnection);
            wss.NewConnection         += new MessageEventHandler(this.OnNewConnection);
            wss.ClientMessageReceived += new MessageEventHandler(this.OnNewMessage);

            //wss.Start("http://localhost:8080/MUD/");
            wss.Start("http://159.89.227.216:8080/MUD/");

            /*
             * JSONMessage message = new JSONMessage();
             * message.Message = "Hey";
             * message.Name = "Server";
             * //Console.WriteLine(msg);
             */

            //BasicInfo binfo = JsonConvert.DeserializeObject<BasicInfo>(msg);
            //string json = JsonConvert.SerializeObject(message);

            while (true)
            {
                Thread.Sleep(1);
            }
        }
 public ChannelGroupSettings(ChannelGroupSettings other) : this(msclPINVOKE.new_ChannelGroupSettings__SWIG_1(ChannelGroupSettings.getCPtr(other)), true)
 {
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public ChannelGroupSettingsEnumerator(ChannelGroupSettings collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
 public void SetRange(int index, ChannelGroupSettings values)
 {
     msclPINVOKE.ChannelGroupSettings_SetRange(swigCPtr, index, ChannelGroupSettings.getCPtr(values));
     if (msclPINVOKE.SWIGPendingException.Pending)
     {
         throw msclPINVOKE.SWIGPendingException.Retrieve();
     }
 }
        public ChannelGroupSettings settings()
        {
            ChannelGroupSettings ret = new ChannelGroupSettings(msclPINVOKE.ChannelGroup_settings(swigCPtr), false);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public static ChannelGroupSettings Repeat(WirelessTypes.ChannelGroupSetting value, int count)
        {
            global::System.IntPtr cPtr = msclPINVOKE.ChannelGroupSettings_Repeat((int)value, count);
            ChannelGroupSettings  ret  = (cPtr == global::System.IntPtr.Zero) ? null : new ChannelGroupSettings(cPtr, true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
        public ChannelGroupSettings GetRange(int index, int count)
        {
            global::System.IntPtr cPtr = msclPINVOKE.ChannelGroupSettings_GetRange(swigCPtr, index, count);
            ChannelGroupSettings  ret  = (cPtr == global::System.IntPtr.Zero) ? null : new ChannelGroupSettings(cPtr, true);

            if (msclPINVOKE.SWIGPendingException.Pending)
            {
                throw msclPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ChannelGroupSettings obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }