<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>SuperSocket Discussions Rss Feed</title><link>http://supersocket.codeplex.com/Thread/List.aspx</link><description>SuperSocket Discussions Rss Description</description><item><title>New Post: Sending Order</title><link>http://supersocket.codeplex.com/discussions/446375</link><description>&lt;div style="line-height: normal;"&gt;If there are two pieces of data coming from two threads, anyway you cannot ensure the order because you cannot control the CPU scheduler.&lt;br /&gt;
&lt;br /&gt;
If you want to keep the original order of many pieces of data, put your ordered data into a list and then send the list directly:&lt;br /&gt;
session.Send(list);&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Wed, 19 Jun 2013 16:51:41 GMT</pubDate><guid isPermaLink="false">New Post: Sending Order 20130619045141P</guid></item><item><title>New Post: Do you recommend TLS over SSL3 for SuperSocket?</title><link>http://supersocket.codeplex.com/discussions/446542</link><description>&lt;div style="line-height: normal;"&gt;Sorry, I have no idea about it.&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Wed, 19 Jun 2013 16:49:39 GMT</pubDate><guid isPermaLink="false">New Post: Do you recommend TLS over SSL3 for SuperSocket? 20130619044939P</guid></item><item><title>New Post: Do you recommend TLS over SSL3 for SuperSocket?</title><link>http://supersocket.codeplex.com/discussions/446542</link><description>&lt;div style="line-height: normal;"&gt;Do you recommend TLS over SSL3 for SuperSocket? If so, why?&lt;br /&gt;
&lt;br /&gt;
Thank you.&lt;br /&gt;
&lt;/div&gt;</description><author>eggnog</author><pubDate>Mon, 10 Jun 2013 10:11:45 GMT</pubDate><guid isPermaLink="false">New Post: Do you recommend TLS over SSL3 for SuperSocket? 20130610101145A</guid></item><item><title>New Post: SSL Socket RENEGOTIATION</title><link>http://supersocket.codeplex.com/discussions/433794</link><description>&lt;div style="line-height: normal;"&gt;Hi eggnog,&lt;br /&gt;
&lt;br /&gt;
no we use to host it on a Windows Server 2008 R2.&lt;br /&gt;
&lt;br /&gt;
Cheers, Alex&lt;br /&gt;
&lt;/div&gt;</description><author>faulandcc</author><pubDate>Mon, 10 Jun 2013 09:13:49 GMT</pubDate><guid isPermaLink="false">New Post: SSL Socket RENEGOTIATION 20130610091349A</guid></item><item><title>New Post: SSL Socket RENEGOTIATION</title><link>http://supersocket.codeplex.com/discussions/433794</link><description>&lt;div style="line-height: normal;"&gt;You were hosting with Windows XP?&lt;br /&gt;
&lt;/div&gt;</description><author>eggnog</author><pubDate>Mon, 10 Jun 2013 06:24:57 GMT</pubDate><guid isPermaLink="false">New Post: SSL Socket RENEGOTIATION 20130610062457A</guid></item><item><title>New Post: Sending Order</title><link>http://supersocket.codeplex.com/discussions/446375</link><description>&lt;div style="line-height: normal;"&gt;But are the items always successfully queued in the order that Send(ArraySegment&amp;lt;byte&amp;gt;) is called, and if they do not send immediately, and more requests come, do they ever change order?&lt;br /&gt;
&lt;br /&gt;
I ask this because I have noticed that there is a spin wait which may occur while the data is attempting to queue, and other times the queue itself is replaced.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;private void InternalSend(ArraySegment&amp;lt;byte&amp;gt; segment)
{
    if (!m_Connected)
        return;

    //data queued in here
    if (InternalTrySend(segment))
        return;

    var spinWait = new SpinWait();

    while (m_Connected)
    {
        spinWait.SpinOnce();

        if (InternalTrySend(segment))
            return;
    }
}&lt;/code&gt;&lt;/pre&gt;

Isn't it possible that different requesting threads will enter this context, and maybe succeed in queuing in a different order?&lt;br /&gt;
&lt;br /&gt;
Thanks again.&lt;br /&gt;
&lt;/div&gt;</description><author>eggnog</author><pubDate>Sat, 08 Jun 2013 05:01:02 GMT</pubDate><guid isPermaLink="false">New Post: Sending Order 20130608050102A</guid></item><item><title>New Post: Sending Order</title><link>http://supersocket.codeplex.com/discussions/446375</link><description>&lt;div style="line-height: normal;"&gt;Needn't do it. The queue is thread safe, and first queued data must be sent first.&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Sat, 08 Jun 2013 04:37:38 GMT</pubDate><guid isPermaLink="false">New Post: Sending Order 20130608043738A</guid></item><item><title>New Post: send size limit</title><link>http://supersocket.codeplex.com/discussions/446387</link><description>&lt;div style="line-height: normal;"&gt;No limitation.&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Sat, 08 Jun 2013 04:36:01 GMT</pubDate><guid isPermaLink="false">New Post: send size limit 20130608043601A</guid></item><item><title>New Post: send size limit</title><link>http://supersocket.codeplex.com/discussions/446387</link><description>&lt;div style="line-height: normal;"&gt;Is there a limit to the number of bytes in the ArraySegment&amp;lt;byte&amp;gt; we pass to AppSession.Send?&lt;br /&gt;
&lt;br /&gt;
If so, what is the limit and how can it be configured?&lt;br /&gt;
&lt;br /&gt;
For example, would this fail?&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;mySegment = DataSource.GetBytes();  //return 1mb
Assert.Equals(mySegment.Array.Length, 1048576);
myAppSession.Send(mySegment);&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>eggnog</author><pubDate>Sat, 08 Jun 2013 02:49:14 GMT</pubDate><guid isPermaLink="false">New Post: send size limit 20130608024914A</guid></item><item><title>New Post: Fast Broadcast</title><link>http://supersocket.codeplex.com/discussions/275777</link><description>&lt;div style="line-height: normal;"&gt;&lt;strong&gt;Khyalis wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;blockquote&gt;
s.SendResponse(message);&lt;br /&gt;
&lt;/blockquote&gt;
Since Khyalis posted this, SendResponse has been deprecated. Instead use Send(ArraySegment&amp;lt;byte&amp;gt; segment)&lt;br /&gt;
&lt;br /&gt;
You could also take a cue from the souce. The following method is in SuperSocket.SocketBase.AppServer&amp;lt;TAppSession, TRequestInfo&amp;gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;/// &amp;lt;summary&amp;gt;
/// Clears the idle session.
/// &amp;lt;/summary&amp;gt;
/// &amp;lt;param name=&amp;quot;state&amp;quot;&amp;gt;The state.&amp;lt;/param&amp;gt;
private void ClearIdleSession(object state)
{
    if (Monitor.TryEnter(state))
    {
        try
        {
            DateTime now = DateTime.Now;
            DateTime timeOut = now.AddSeconds(0 - Config.IdleSessionTimeOut);

            var timeOutSessions = SessionSource.Where(s =&amp;gt; s.Value.LastActiveTime &amp;lt;= timeOut).Select(s =&amp;gt; s.Value);
            System.Threading.Tasks.Parallel.ForEach(timeOutSessions, s =&amp;gt;
                {
                    if (Logger.IsInfoEnabled)
                        Logger.Info(s, string.Format(&amp;quot;The session will be closed for {0} timeout, the session start time: {1}, last active time: {2}!&amp;quot;, now.Subtract(s.LastActiveTime).TotalSeconds, s.StartTime, s.LastActiveTime));
                    s.Close(CloseReason.TimeOut);
                });
        }
        catch (Exception e)
        {
            if(Logger.IsErrorEnabled)
                Logger.Error(&amp;quot;Clear idle session error!&amp;quot;, e);
        }
        finally
        {
            Monitor.Exit(state);
        }
    }
}&lt;/code&gt;&lt;/pre&gt;

It is used to close the sessions, but could just as easily be used to call Send on them.&lt;br /&gt;
&lt;br /&gt;
Also, check out this excellent blog post for other options and explantions as to how the different options (including the above example) effect thread blocking, etc:&lt;br /&gt;
&lt;a href="http://www.hanselman.com/blog/BackToParallelBasicsDontBlockYourThreadsMakeAsyncIOWorkForYou.aspx" rel="nofollow"&gt;Make Async I/O Work For You&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>eggnog</author><pubDate>Fri, 07 Jun 2013 23:19:49 GMT</pubDate><guid isPermaLink="false">New Post: Fast Broadcast 20130607111949P</guid></item><item><title>New Post: Sending Order</title><link>http://supersocket.codeplex.com/discussions/446375</link><description>&lt;div style="line-height: normal;"&gt;Hi  kerryjiang &lt;br /&gt;
&lt;br /&gt;
Congratulations on an amazing framework! I have a lot of respect for your work.&lt;br /&gt;
&lt;br /&gt;
I tried to understand the code for sending, but the queuing code is complex and I am not confident.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;public class MySession : AppSession&amp;lt;MySession, BinaryRequestInfo&amp;gt;
{
    private readonly _sendLock = new object();
    
    internal void MySend(ArraySegment&amp;lt;byte&amp;gt; data)
    {
        lock (_sendLock)
        {
            Send(data);
        }
    }
}&lt;/code&gt;&lt;/pre&gt;

If MySend is the only way I call Send, is it guaranteed that the segments will be sent in the order that Send is called?&lt;br /&gt;
&lt;br /&gt;
If not, do I need to set Config.SendSync = true?&lt;br /&gt;
&lt;br /&gt;
Thank you very much.&lt;br /&gt;
&lt;/div&gt;</description><author>eggnog</author><pubDate>Fri, 07 Jun 2013 22:40:31 GMT</pubDate><guid isPermaLink="false">New Post: Sending Order 20130607104031P</guid></item><item><title>New Post: FTP Server using supersocket</title><link>http://supersocket.codeplex.com/discussions/446179</link><description>&lt;div style="line-height: normal;"&gt;The default encoding is ASCII, you needn't change it.&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Thu, 06 Jun 2013 09:06:44 GMT</pubDate><guid isPermaLink="false">New Post: FTP Server using supersocket 20130606090644A</guid></item><item><title>New Post: FTP Server using supersocket</title><link>http://supersocket.codeplex.com/discussions/446179</link><description>&lt;div style="line-height: normal;"&gt;Hi kerry,&lt;br /&gt;
I want use Suppersocket for a FTP server. In FTP, as it is used to send commands to the server and for the server to send responses back to the client, , text based way of sending commands and receiving responses based on TELNET, using the ASCII character set.&lt;br /&gt;
I have tested Telnet project in QuickStart. In my project FTP server, i'm using &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;public FTPServer() : base(new CommandLineReceiveFilterFactory(Encoding.ASCII, new BasicRequestInfoParser(&amp;quot; &amp;quot;, &amp;quot;,&amp;quot;)))&lt;/code&gt;&lt;/pre&gt;

I can not get to the data sent from client to Ftp server.&lt;br /&gt;
&lt;br /&gt;
 Any ideas what I could be doing wrong? &lt;br /&gt;
&lt;br /&gt;
Thank you!!!&lt;br /&gt;
&lt;/div&gt;</description><author>chinhnguyen</author><pubDate>Thu, 06 Jun 2013 08:55:56 GMT</pubDate><guid isPermaLink="false">New Post: FTP Server using supersocket 20130606085556A</guid></item><item><title>New Post: Dealing with multiple protocols</title><link>http://supersocket.codeplex.com/discussions/445754</link><description>&lt;div style="line-height: normal;"&gt;Good, you can design a SwitchReceiveFilter to detect protocol, when you find the mark byte, then you should set the NextReceiveFilter of the switch filter with the different protocols' receive filters.&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Tue, 04 Jun 2013 03:32:52 GMT</pubDate><guid isPermaLink="false">New Post: Dealing with multiple protocols 20130604033252A</guid></item><item><title>New Post: Dealing with multiple protocols</title><link>http://supersocket.codeplex.com/discussions/445754</link><description>&lt;div style="line-height: normal;"&gt;Well, it turned out that I needed to have this done before I could even think about it so I ended up implementing my own Receive Filter, I don't have the code right now but what it does is basically:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;if it's protocol &amp;quot;A&amp;quot; then
    myProtocol = &amp;quot;A&amp;quot;
else if it's protocol &amp;quot;B&amp;quot; then
    myProtocol = &amp;quot;B&amp;quot;
...
&lt;/code&gt;&lt;/pre&gt;

For instance, one protocol has a fixed header length while another protocol has start/end delimiters, I can differentiate them by checking the first byte of the binary request, then I set a different command key string according to the received protocol, it seems to work just fine.&lt;br /&gt;
&lt;br /&gt;
Thanks for developing SuperSocket!&lt;br /&gt;
&lt;/div&gt;</description><author>JetShark</author><pubDate>Tue, 04 Jun 2013 03:09:01 GMT</pubDate><guid isPermaLink="false">New Post: Dealing with multiple protocols 20130604030901A</guid></item><item><title>New Post: Dealing with multiple protocols</title><link>http://supersocket.codeplex.com/discussions/445754</link><description>&lt;div style="line-height: normal;"&gt;Could you tell me how to choose receive filter in the server side? It is the key to answer your question.&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Mon, 03 Jun 2013 02:04:31 GMT</pubDate><guid isPermaLink="false">New Post: Dealing with multiple protocols 20130603020431A</guid></item><item><title>New Post: Dealing with multiple protocols</title><link>http://supersocket.codeplex.com/discussions/445754</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I need to implement an UDP server which can handle multiple protocols, these binary requests could have fixed length headers while others could have start/end delimiters, and there could be even more protocols added in the future, these are all sent to the same socket and the protocols are fixed so I can't change them.&lt;br /&gt;
&lt;br /&gt;
So, given a binary stream sent via UDP, I need to be able to &amp;quot;choose&amp;quot; which receive filter will parse it and call its corresponding commands, but I haven't figured out an easy way do this, is there an standard way to do this? or do I have to write my own receive filter?&lt;br /&gt;
&lt;br /&gt;
Thanks in advance!&lt;br /&gt;
&lt;/div&gt;</description><author>JetShark</author><pubDate>Mon, 03 Jun 2013 00:46:05 GMT</pubDate><guid isPermaLink="false">New Post: Dealing with multiple protocols 20130603124605A</guid></item><item><title>New Post: How to access AppServer and WebSocketServer</title><link>http://supersocket.codeplex.com/discussions/444948</link><description>&lt;div style="line-height: normal;"&gt;Thank you. That looks like what I need to know.&lt;br /&gt;
&lt;/div&gt;</description><author>ik606</author><pubDate>Sat, 25 May 2013 13:36:21 GMT</pubDate><guid isPermaLink="false">New Post: How to access AppServer and WebSocketServer 20130525013621P</guid></item><item><title>New Post: How to access AppServer and WebSocketServer</title><link>http://supersocket.codeplex.com/discussions/444948</link><description>&lt;div style="line-height: normal;"&gt;&lt;a href="http://docs.supersocket.net/v1-5/Multiple-Server-Instances" rel="nofollow"&gt;http://docs.supersocket.net/v1-5/Multiple-Server-Instances&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Please read the last part of this doc.&lt;br /&gt;
&lt;/div&gt;</description><author>kerryjiang</author><pubDate>Sat, 25 May 2013 13:23:14 GMT</pubDate><guid isPermaLink="false">New Post: How to access AppServer and WebSocketServer 20130525012314P</guid></item><item><title>New Post: How to access AppServer and WebSocketServer</title><link>http://supersocket.codeplex.com/discussions/444948</link><description>&lt;div style="line-height: normal;"&gt;Background:&lt;br /&gt;
I have created a program which has 2 services defined, one is inherited from AppServer, and the other is inherited from WebSocketServer.&lt;br /&gt;
My program runs as a Windows Service.&lt;br /&gt;
The reason for using both SuperSocket and SuperWebSocket is because the SuperWebSocket accepts a connection from an Administrator via  Web Browser using WebSockets.&lt;br /&gt;
The other clients use a TcpClient, and that connects to the SuperSocket.&lt;br /&gt;
I have no problem connecting my Administrator to the SuperWebSocket, and my clients to the SuperSocket.&lt;br /&gt;
&lt;br /&gt;
QUESTION:&lt;br /&gt;
In my class, inherited from WebSocketServer, I would like to be able to provide a way for the Administrator to view the Sessions of the AppServer, and send instructions to individual clients.&lt;br /&gt;
&lt;br /&gt;
I am just not sure of the proper way to access the AppServer object. I tried making a temp copy of the AppServer, and accessing the sessions that way. But it never really worked properly. I am new to C# and .NET, but have 15+ years of C++/Unix. &lt;br /&gt;
&lt;br /&gt;
Thank you&lt;br /&gt;
&lt;/div&gt;</description><author>ik606</author><pubDate>Sat, 25 May 2013 02:45:25 GMT</pubDate><guid isPermaLink="false">New Post: How to access AppServer and WebSocketServer 20130525024525A</guid></item></channel></rss>