Can not implement custom WebSocketServer

Oct 30, 2013 at 1:45 PM
Hi kerry-jiang,

I try to implement my Custom WebSocket Server by your document at http://docs.supersocket.net/v1-6/en-US/Implement-your-AppServer-and-AppSession like following code:

public class IGWebSocketSession
{
    public int TestID{ get; set; }       

}
public class IGWebSocketServer: WebSocketServer<IGWebSocketSession>
{

}

Visual Studio flow error:

Error 1 The type 'System.Net.Socket.Web.IGWebSocketSession' cannot be used as type parameter 'TWebSocketSession' in the generic type or method 'SuperWebSocket.WebSocketServer<TWebSocketSession>'. There is no implicit reference conversion from 'System.Net.Socket.Web.IGWebSocketSession' to 'SuperWebSocket.WebSocketSession<System.Net.Socket.Web.IGWebSocketSession>'. I:\WORKS\DropBox\Dropbox\WORKING\PROJECTS\WebSocket\superwebsocketserver-source\IGWebSocketServer\IGWebSocketServer.cs 9 18 IGWebSocket

How can i do custom websocket server?

Regards,
Tuansavi
Coordinator
Oct 30, 2013 at 3:38 PM
No, you cannot follow the doc of SuperSocket, please look into the Sample projects of SuperWebSocket.
Oct 31, 2013 at 4:34 AM
Hi Kerryjiang,

I implement new Session and Server ok (with assembles version 1.5.4.0), but when i implement new session


public class IGWebSocketSession
{
public int TestID{ get; set; }       
}
public class IGWebSocketServer: WebSocketServer<IGWebSocketSession>
{

}

public static IGWebSocketServer m_WebSocketServer = new IGWebSocketServer();

HERE IS an error occur:

The type 'SuperWebSocket.WebSocketServer`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'com.web.sk, Version=0.8.0.0, Culture=neutral, PublicKeyToken=7ba53b9a7cef5d1c'.

I checked that i added all nessesary dlls: Common, SocketBase, SocketEngine, log4net (with same version) in to com.web.sk (assembly).

How can i fix this error?
Coordinator
Oct 31, 2013 at 4:37 AM
No, completely wrong.

Please check out the sample project in SuperWebSocket, there is a sample project for custom server and session.