C# Socket.IO Server?

6,268 views
Skip to first unread message

MattCruikshank

unread,
Feb 7, 2012, 5:21:25 PM2/7/12
to Socket.IO
I'd love to have a C# Socket.IO Server, even if it only supported a
WebSocket connection from the latest Chrome.

...would anyone care to share? :-)

-Matt

James

unread,
Feb 8, 2012, 3:20:24 AM2/8/12
to sock...@googlegroups.com
me too!

I needed something working quickly so went with signalR.

But I didn't like the client side syntax when compared to socket.io….

So much so that I wrote a little wrapper making my client side code look like socket.io

I only needed a bit of the functionality as you can see.

window.io = do ->
  config = transport: 'longPolling'
  connect = (name) ->
    hub = $.connection[name]
    emitQueue = []; clientId = null
    $.connection.hub.start transport: config.transport, ->
      clientId = @clientId
      while item=emitQueue.shift()
        hub[item.name].apply hub, item.args
      hub.connect?()
    clientId: -> clientId
    on: (name, callback) ->
      f = ->
        callback.apply(hub, Array().slice.call(arguments))
      hub[name] = f
      callback() if name is 'connect' and clientId?
    emit: ->
      args = Array().slice.call arguments
      name = args.shift()
      if clientId
        hub[name].apply hub, args
      else
        emitQueue.push name: name, args: args
  connect: connect, config: config

socket = io.connect('command') # signalR's hub

socket.on 'hello', ->
  socket.emit 'hello', from: 'client'
  console.log "Received hello form server"

It would be great to see socket.io available for pure .NET apps.

James Kyburz
Cell: +46 734 448489 | Google Talk: james.kyburz | Skype: james.kyburz

Prabir Shrestha

unread,
May 22, 2012, 12:39:04 PM5/22/12
to sock...@googlegroups.com
I'm working on a sample proof of concept socket.io protocol for asp.net 4.5+ and iis8.

Partial implementation can be found at  https://gist.github.com/2769940 and discussion at  http://jabbr.net/#/rooms/aspnet 

It is at a very early stage so everything is crammed in one file for now.
Reply all
Reply to author
Forward
0 new messages