博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WebSocket4Net
阅读量:6125 次
发布时间:2019-06-21

本文共 6232 字,大约阅读时间需要 20 分钟。

WebSocket4Net

WebSocket4Net is a .NET websocket client

implementation.

It originated from

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:

Demo code:

using WebSocket4Net; WebSocket websocket = new WebSocket("ws://localhost:2012/");websocket.Opened += new EventHandler(websocket_Opened);websocket.Error += new EventHandler
(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

- 

Consult/feature request:

 

 

 

 

C# Websocket Implementation     

Sorry, but there was a problem saving your changes.

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

Read-Only access

Octotip: 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

      authored 2 months ago
name age
            message         
2 months ago []
6 months ago []
5 months ago []
5 months ago []
3 months ago []
readme.markdown

Fleck project-status

Fleck is a WebSocket server implementation in C#. Branched from the 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.

 

 

 

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

 

 

 

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   

Latest beta release:

SuperSocket 1.5 beta 1   

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 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:

Skype: kerry-jiang

Google+:

Author's LinkedIn profile:

LinkedIn Group:

QQ Group: 135969383

 

 

转载地址:http://oefua.baihongyu.com/

你可能感兴趣的文章
看了这篇文章,了解深度卷积神经网络在目标检测中的进展
查看>>
全球最热门大数据公司TOP10 中国公司榜上有名
查看>>
海润光伏完成印度特伦甘纳邦8.2兆瓦分布式光伏电站
查看>>
苹果怒了:将协助富士康等代工厂诉讼高通
查看>>
一张图看懂数据科学家、数据工程师和软件工程师之间的区别
查看>>
美国借“外部黑客”测试政府网络安全性
查看>>
智能语音为入口,引领物联网开启人机交互新模式
查看>>
NAND 闪存需求提升 东芝调高上半年获利预测
查看>>
打造中国500强法尔胜分布式屋顶项目 晶科电力助推江苏低碳转型
查看>>
互联网域名管理办法即将出台 非国内域名不予接入
查看>>
详解ARM Cortex-M33处理器:性能/功耗/安全的最佳平衡
查看>>
智能手机在安防领域的应用势不可挡
查看>>
芬兰政府计划于2018年提供5G测试频谱
查看>>
被社交巨头们盯上的直播,又在过把瘾就死?
查看>>
NFC技术 为物联网搭起桥梁
查看>>
苹果CFO抨击欧盟税务调查:不欠一分钱
查看>>
专家:刷脸登录有漏洞 互联网企业在玩"噱头"
查看>>
三星“掌门人”李在镕身在看守所 但仍“遥控”三星
查看>>
操作系统的基本架构
查看>>
中植集团应用博雅全视频会议系统
查看>>