Upload
pablo-monterde-perez
View
521
Download
5
Embed Size (px)
Citation preview
Real Time applications with sockets
Introduction to SmartfoxServer 2x
Sponsors
Pablo Monterde - IT Manager
Softalian:
● SEO Agency● Web Development
Dinacode:
● IT Consulting● Adhoc Development● Internal projects
@pablomonterdep
Projects
● Doyugames.com● Gamesnan.com● Casualarena.com● +30 casual games real-
time multiuser
Context
What is Real-Time?
● Web: 1 httpRequest - ~300 - 500 ms● System Monitoring: ~1 - 5 segs● Messaging Application: ~ 500ms - 20 segs● Collaborative Application: 1 Message - ~50 - 100 ms - FULL DUPLEX● Chat Application: 1 Message - ~50 - 100 ms - FULL DUPLEX● Multiplayer games : 1- 2 Frames - ~ 40ms - FULL DUPLEX
“Time is relative”
Multi-User Application
user - user server - user
user - broadcast server - broadcast
Multiple clients
Potencial Applications
1. Complex Chat2. Realt-time Monitoring Application3. Collaborative Application - Whiteboard, Shared
docs…4. Industrial Control System5. Data Acquisition Server6. Multiplayer Games
Protocols - HTTP - Restful
● Simple● All clients support● Mature - Developer Experience● Many server - framework - libraries
options● Ajax● Scalability
PROS
Protocols - HTTP - Restful
● No persistent connection● No server to client messages● Http - Header size● Pull based application - one direction● Latency● New connection per request
CONS
Protocols - Socket - Websocket
● Permanent connection● Full duplex - bidirectional● New Websocket ● Low latency● Overhead Reduction● Dramatically Header Reduction
PROS
Protocols - Socket - Websocket
● Scalability● Less server - frameworks - libraries
options● Session management - session is evil● Reconnection management● Developer experience● Complex
Cons
Server - Client Communication
vs
Client - Client Communication
?
Client - Client Communication
So...Which Protocol?
Socket - Websocket
Let´s Start !!!
2X
OverviewSmartFoxServer is a multi-platform client/server SDK designed to integrate with the major online web and mobile technologies (Adobe Flash, Unity, iOS, Android, Java, Windows Phone 8, HTML5, Windows 10) enabling developers to rapidly created multiuser experiences of all scales.
Customer
Components
Client API
Socket Server Web Server
Server Side
Client Side
Clients
Clients Examples
Features● High performance network engine
● Binary protocol with dynamic compression
● Public and private chat messaging - bad words filter
● Server-side variables (User Variables / Room
Variables) - Synchronization
● Auto kick idle users
● Dynamically create Rooms
● Logging capabilities
● Administrator messages
● Moderator support (kick / ban actions)
● Flooding filter with auto-kick / auto-ban functions
● IP filtering
● Persistent banned users list
● Web-based administration tool
● HTTP Tunnelling for firewall and proxy traversal
● Secure encrypted login system
● Embedded web server supporting Java servlet
● Server-side Extensions
● Direct database connectivity
● Mailer system
● Internal event dispatching system
● HRC system for transparent reconnection of unstable
clients
● UDP support
● User profiles and permissions system
● Rooms management (renaming, locking, resizing...)
● "Ghost users" hunting system
● Special MMO API for "Area of Interest"-based users
proximity notification
● Game API (match-making,Invitations,challenges
Features - Connection & network● Sockets & WebSockets
● Session => Login Management => User
● Package Compression Configuration
● Http tunneling for clients unable to establish socket connections
● Ghost Hunter
● HRC system for transparent reconnection of unstable clients
Features - Zones & Rooms
● Zone extensions - server logic
● Room extensions - server logic
● Users join Zones
● Users join Rooms
● Room Variables
● Room Permissions
● Room Events
Zone A
User A
Room A
User B
Room B
Zone B Zone C
User C
Synchronization - User & Room vars Room
User A User B User C
Communication - User 2 User
User A
User B
Send Public Message
Room
User C
Communication - User 2 User
User A User B
Send Private Message
Communication - User 2 User
User A
User B
Send Object Message
Room
User C
Communication - Server 2 User
Zone A
User A
Room A - extension
User B
Room B
Zone B - extension Zone C
User C
Communication - Server 2 UserSfs Extension
Communication - Server 2 UserHandles
Features - Security
● Ban Manager - ( name | IP )
● Flood Filter
● Words filter - (whitelist | blacklist)
● Privilege manager - (profiles | roles)
● Moderator manager
Features - Web Server - Jetty
Socket Server Web Server
Server Side
Features - Administration Tool - Profiling
Features - Administration Tool - Logging
Features - Administration Tool - Zone
Features - Administration Tool - Room
Features - Administration Tool - User
On the other hand
Scalability - Bad Horizontal Scalability HTTP Diagram
SFS Diagram
STICKY SESSION
No Open Source - License
Community License Elastic License Perpetual License
● Free● 100 CCU● 100% features
● Payment per day ● Prize depends on CCU max
● Never expire● Prize per CCU max● One time fee
Thanks
www.cooldeveloper.xyz