WebSocket4Net


WebSocket4Net


WebSocket4Net is a .NET websocket client
implementation.


It originated from SuperWebSocket
WebSocket Client. For better developing of the websocket client, it was
separated from SuperWebSocket and was renamed to
WebSocket4Net.

WebSocket4Net will provide websocket client implementation
for many different kinds of runtime:



  • .Net 3.5
  • .Net 4.0
  • Mono
  • Silverlight
  • WindowsPhone
  • Mono for Android
  • MonoTouch


  MonoWindows Phone



It is compatible with many websocket drafts:



  • Hybi-00
  • Hybi-10
  • RFC6455


NuGet Package: http://www.nuget.org/packages/WebSocket4Net



Demo code:



using WebSocket4Net;
 
WebSocket websocket = new WebSocket("ws://localhost:2012/");
websocket.Opened += new EventHandler(websocket_Opened);
websocket.Error += new EventHandler<ErrorEventArgs>(websocket_Error);
websocket.Closed += new EventHandler(websocket_Closed);
websocket.MessageReceived += new EventHandler(websocket_MessageReceived);
websocket.Open();

private void websocket_Opened(object sender, EventArgs e)
{
     websocket.Send("Hello World!");
}



Recommended .NET WebSocket Server


SuperWebSocket -  http://superwebsocket.codeplex.com/



Consult/feature request:


kerry-jiang@hotmail.com


 

 

 

https://github.com/statianzo/Fleck

 

  1. C#95.6%
  2. Ruby4.3%
  3. Shell0.1%

C# Websocket Implementation      Read more

Sorry, but there was a problem saving your changes.

Add a description to this repository
Add a website to this repository
Save Changes

Cancel

Read-Only access

DismissOctotip: You've activated the file finder        by pressing t Start typing to filter the        file list. Use and        to navigate,        enter to view files.     

name
No matching files

Jump to Line

Go

Latest commit to the master branch

readme.markdown

Fleck project-status

Fleck is a WebSocket server implementation in C#. Branched from theNugget project, Fleck requires no inheritance, container, or additional references.

Example

The following is an example that will echo to a client.

var server = new WebSocketServer("ws://localhost:8181");
server.Start(socket =>
  {
    socket.OnOpen = () => Console.WriteLine("Open!");
    socket.OnClose = () => Console.WriteLine("Close!");
    socket.OnMessage = message => socket.Send(message);
  });

Supported WebSocket Versions

Fleck supports several WebSocket versions of modern web browsers

  • Hixie-Draft-76/Hybi-00 (Safari 5, Chrome < 14, Firefox 4 (when enabled))
  • Hybi-07 (Firefox 6)
  • Hybi-10 (Chrome 14-16, Firefox 7)
  • Hybi-13 (Chrome 17+)

Secure WebSockets (wss://)

Enabling secure connections requires two things: using the scheme wss instead of ws, and pointing Fleck to an x509 certificate containing a public and private key

var server = new WebSocketServer("wss://localhost:8431");
server.Certificate = "MyCert.cer";
server.Start(socket =>
  {
    //...use as normal
  });

License

The MIT License

Copyright (c) 2010-2012 Jason Staten

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 

 

 

------------------------------------------------------------------------------------------

 

 

http://supersocket.codeplex.com/

 


SuperSocket is a light weight, cross platform and extensible
socket application framework. You can use it to build a server side socket
application (like FTP server, SMTP/POP3/IMAP4 server, SIP server, SNMP server,
etc) easily without thinking about how to use socket, how to maintain the socket
connections and how socket works(synchronize/asynchronize).

It is a pure
C# project which is designed to be extended, so it is easy to be integrated to
your existing system. If your systems (like forum/CRM/MIS/HRM/ERP) are developed
in .NET language, you must be able to use SuperSocket to build
your socket application as a part of your current system perfectly.

I
know there are two famous NIO open source frameworks named
"MINA" and "Netty" in Java World which are
used widely by developers. If you want to look for a .NET portion of MINA or
Netty, I suggest you try SuperSocket, although
SuperSocket is not strong like MINA and Netty but it is very
simple and you can use it easily.

The source code of
SuperSocket also include some service implementation samples
which you can follow.


Latest stable release:


SuperSocket 1.4 SP3    http://supersocket.codeplex.com/releases/view/82616


Latest beta release:


SuperSocket 1.5 beta 1    http://supersocket.codeplex.com/releases/view/82807


Features:



  • Very easy to use. You can create a robust socket server only by several
    classes
  • Support Sync and Async communication
    modes. You can change your socket server running mode by only changing
    configuration wihtout any code changes
  • Support custom protocol, no matter your protocol is a command line protocol
    or a binary one. Another open source project SuperWebSocket is built
    upon SuperSocket and take advantage of this custom protocol
    feature of it.
  • Support SSL/TLS encryption automatically
  • Support multiple socket server instances. You can define many socket servers
    on different ports in configuration, SuperSocket can run those
    servers in the same application/service
  • SuperSocket can run as console application and windows
    service. It provide a bat file to install SuperSocket as a
    windows service.
  • Flexible logging strategy which can log most of socket activities
  • Also support UDP socket
  • Support IPv6
  • Support Windows Azure
  • Support running in Unix system (by Mono 2.10 or above
    version)
  • Built-in socket policy server for Flash and Silverlight clients which you
    can use directly


MONO           windows azure



Documentation:




Consult/feature request/paid project customization:


kerry-jiang@hotmail.com


Skype: kerry-jiang


Google+: https://plus.google.com/103256006501871418573/


Author's LinkedIn profile: http://cn.linkedin.com/in/kerryjiang


LinkedIn Group: http://www.linkedin.com/groups/SuperSocket-User-Group-3821247


QQ Group: 135969383

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值