UDP Server

Jun 2, 2012 at 11:43 AM

Hi, where can i find the demo or any information on how to setup a UDP server with this library?

Jun 2, 2012 at 11:46 AM

There is a configuration attribute named as "mode", you can set it to be "Udp" to make your server run as Udp.

http://supersocket.codeplex.com/wikipage?title=Basic%20configuration&referringTitle=Documentation

Jun 6, 2012 at 3:15 AM

Hi Jiang

I get this error:

2012-06-06 09:04:14,136 [7928] ERROR ArduMotion UDP Server - System.NotSupportedException: Unsupported SocketMode:Udp
   at SuperSocket.SocketEngine.SocketServerFactory.CreateSocketServer[TRequestInfo](IAppServer appServer, ListenerInfo[] listeners, IServerConfig config, IRequestFilterFactory`1 requestFilterFactory) in C:\Projects\Proj.Server\Library\Supersocket\mainline\SocketEngine\SocketServerFactory.cs:line 56
   at SuperSocket.SocketBase.AppServerBase`2.SetupSocketServer() in C:\Projects\Proj.Server\Library\Supersocket\mainline\SocketBase\AppServerBase.cs:line 470
2012-06-06 09:04:14,154 [7928] ERROR Global - Failed to setup server instance!
2012-06-06 09:04:14,154 [7928] ERROR Global - Failed to initialize server ArduMotion UDP Server!

 

      <server name="ArduMotion UDP Server"
              serviceName="ArduMotionUDPService"
              ip="Any" port="8888"
              mode="Udp"
              maxConnectionNumber="10000"
              keepAliveTime="1800"
              disableSessionSnapshot = "true"
            clearIdleSession="true">
      </server>

What am I doing wrong? 

 

 

Jun 6, 2012 at 3:18 AM

Please use the latest version of SuperSocket 1.4 instead of 1.5 beta.

Jun 6, 2012 at 7:25 AM

Thanks but now

BinaryRequestInfo is missing since i had already ported all of my code to your new 1.5 version. Why did you disable UDP in 1.5?!!! How soon can you re-enable it?

Jun 6, 2012 at 7:26 AM

Try BinaryCommandInfo in 1.4.

Jun 6, 2012 at 7:27 AM

If your things are urgent, I can start to work on it now.

Jun 6, 2012 at 7:33 AM

Please do i would be grateful. I am making a remote controlled R/C racing car which uses your socket server and it needs to do UDP back/forth. Now that i made the changes that you recommended,

  class MyDataRequestFilter : RequestFilterBase
    {
        private int m_Length;

 

is failing since it cant find  class MyDataRequestFilter : RequestFilterBase<BinaryCommandInfo !!!

 

It is better to make this work on 1.5 than for me to go back to 1.4 and then start over again when u do release 1.5

I would really appreciate it...

 

Jun 7, 2012 at 1:50 AM

Hi, when do you think you can post the new version with UDP enabled again?

Jun 7, 2012 at 2:18 AM

At the end of this week or the beginning of next week.

Jun 7, 2012 at 2:25 AM

thanks so much

Jun 9, 2012 at 9:20 AM

Ok, I have added UDP back to the 1.5 version of SuperSoket, please download the latest source code.

Jun 10, 2012 at 1:10 AM

Thanks so much

From: kerryjiang <notifications@codeplex.com>
Reply-To: <SuperSocket@discussions.codeplex.com>
Date: Saturday, June 9, 2012 3:20 PM
To: Nader Rahimizad <ardumotion@gmail.com>
Subject: Re: UDP Server [SuperSocket:358069]

From: kerryjiang

Ok, I have added UDP back to the 1.5 version of SuperSoket, please download the latest source code.

Jun 12, 2012 at 3:03 AM

Does it work?

Jun 12, 2012 at 1:45 PM

Hi Jiang, thanks it is working fine. Can a single server/session hold multiple socket servers? How could I create a single server that is able to communicate on two ports using the same code/protocol without creating additional servers?

Jun 12, 2012 at 1:53 PM

Do you mean let the AppServer listen on multple ports?

If so, the answer is YES.

You can define multiple listeners for one appServer:

<server name="muServer" ...>
    <listeners>
        <listener ip="xxx" port="yyy" />
        <listener ip="xxx2" port="yyy2" />
    </listeners>
</server>
Jun 12, 2012 at 2:49 PM

Nice, thanks

Is an  AppServer limited to a single AppSession? I am wondering if i can have multiple AppSessions per single AppServer each handling a different protocol (UDP+Socket) on the same iP

Jun 12, 2012 at 2:57 PM

Of couse not!

One appServer can handle lots of sessions at the same time.

Jun 12, 2012 at 4:00 PM

awesome, how can I setup a AppServer and create multiple sessions each with a different protocol and port? for example TCP on Port 888 and UDP on port 888? can u show me a sample App.Conf for this? Thanks so much

Jun 12, 2012 at 4:00 PM

awesome, how can I setup a AppServer and create multiple sessions each with a different protocol and port? for example TCP on Port 888 and UDP on port 888? can u show me a sample App.Conf for this? Thanks so much

Jun 12, 2012 at 4:06 PM

You can check out this config:

http://supersocket.codeplex.com/SourceControl/changeset/view/78918#1418230

Jun 13, 2012 at 1:24 AM
Edited Jun 13, 2012 at 2:29 AM

I guess this is what i need:

 

<servers>
            <server name="ServerA"
                    serviceName="MyAppServerA"
                    ip="Any" port="2012" type="Tcp">
            </server>
            <server name="ServerA"
                    serviceName="MyAppServerA"
                    ip="Any" port="2012" type="Udp">
            </server>
        </servers>

Otherwise if i make MyAppServerA and MyAppServerB then i need to create a new IPC mechanism for the two servers to talk to each other since they share objects and data that they handle between the two types of communications protocols: TCP & UDP

Any thoughts?

Jun 13, 2012 at 3:22 AM

Yes, if you use this configuration, you needn't do any IPC work, because the two instances work in same process, same appDomain. They can access each other easily.

Differnt with v1.4, it provides a property named as "Bootstrap" in AppServer which you can use to access other appServer instances quickly.

Jun 13, 2012 at 11:20 AM

awesome, so is the above correct with  both server name="ServerA" and serviceName="MyAppServerA"

or 2nd server name to be different but the service name to be same for both:   serviceName="MyAppServerA"                   

<servers>
            <server name="ServerTCP"
                    serviceName="MyAppServerA"
                    ip="Any" port="2012" type="Tcp">
            </server>
            <server name="ServerUDP"
                    serviceName="MyAppServerA"
                    ip="Any" port="2012" type="Udp">
            </server>
        </servers>

What would the c# code look like for each instance to access a data class in the other instance?

Jun 13, 2012 at 11:25 AM

There is a sample in QuickStart about it, could you check it out?