Skip to content

esquerbatua/websocket

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

New V-websocket library

This is a refactor of the current web socket library to comply with V-like style of programming. It is built on top of Emily net library and passes all the autobahn tests for clients.

Changes from original websocket implementation

  • Use only built-in datatypes, no voidptrs or byteptr (for now the eventbus require it for callbacks)
  • Relying on V automatic free of resources (not done yet)
  • Client and Server pass autobahn tests excluding compression
  • Use new socket implementation from @Ememily33901 that will soon be standard in V
  • Use Option error handling
  • Refactor code so websocket.v contains only the code to understand basic implementations
    • moved communication to io.v
    • separation of handling frames and finished messages
  • Eventbus dependency removed and using own fn types. Now register callbacks with on_message, on_error, on_open, on_close functions
  • Easy to use webbsocket server

Proposed / planned changes

  • Make server autobahn compliant like client
  • Set own timeouts
  • Make sure it works on windows
  • Strict comply to utf8 autobahn fast fail rule (it comply now but non strict)
  • Publish as module
  • Set if autoping in server = false if time is 0

Future changes after v0.2 of V

  • Generics, use vweb type of app instead of voidptr for reference
  • Interfaces, IO operations as interfaces for making tests more easy

Remarks

  • It should not be used in production since memory management is not done yet in V

Attribution

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • V 94.2%
  • Python 3.5%
  • Dockerfile 2.0%
  • AMPL 0.3%