45
Real Time applications with sockets Introduction to SmartfoxServer 2x

Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Embed Size (px)

Citation preview

Page 1: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Real Time applications with sockets

Introduction to SmartfoxServer 2x

Page 2: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Sponsors

Page 3: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Pablo Monterde - IT Manager

Softalian:

● SEO Agency● Web Development

Dinacode:

● IT Consulting● Adhoc Development● Internal projects

@pablomonterdep

Page 4: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Projects

● Doyugames.com● Gamesnan.com● Casualarena.com● +30 casual games real-

time multiuser

Page 5: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Context

Page 6: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

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”

Page 7: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Multi-User Application

user - user server - user

user - broadcast server - broadcast

Page 8: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Multiple clients

Page 9: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Potencial Applications

1. Complex Chat2. Realt-time Monitoring Application3. Collaborative Application - Whiteboard, Shared

docs…4. Industrial Control System5. Data Acquisition Server6. Multiplayer Games

Page 10: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Protocols - HTTP - Restful

● Simple● All clients support● Mature - Developer Experience● Many server - framework - libraries

options● Ajax● Scalability

PROS

Page 11: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

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

Page 12: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Protocols - Socket - Websocket

● Permanent connection● Full duplex - bidirectional● New Websocket ● Low latency● Overhead Reduction● Dramatically Header Reduction

PROS

Page 13: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Protocols - Socket - Websocket

● Scalability● Less server - frameworks - libraries

options● Session management - session is evil● Reconnection management● Developer experience● Complex

Cons

Page 14: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Server - Client Communication

vs

Page 15: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Client - Client Communication

?

Page 16: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Client - Client Communication

Page 17: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

So...Which Protocol?

Socket - Websocket

Page 18: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Let´s Start !!!

Page 19: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

2X

Page 20: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 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.

Page 21: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Customer

Page 22: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Components

Client API

Socket Server Web Server

Server Side

Client Side

Page 23: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Clients

Page 24: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Clients Examples

Page 25: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

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

Page 26: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

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

Page 27: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

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

Page 28: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Synchronization - User & Room vars Room

User A User B User C

Page 29: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Communication - User 2 User

User A

User B

Send Public Message

Room

User C

Page 30: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Communication - User 2 User

User A User B

Send Private Message

Page 31: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Communication - User 2 User

User A

User B

Send Object Message

Room

User C

Page 32: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Communication - Server 2 User

Zone A

User A

Room A - extension

User B

Room B

Zone B - extension Zone C

User C

Page 33: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Communication - Server 2 UserSfs Extension

Page 34: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Communication - Server 2 UserHandles

Page 35: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Features - Security

● Ban Manager - ( name | IP )

● Flood Filter

● Words filter - (whitelist | blacklist)

● Privilege manager - (profiles | roles)

● Moderator manager

Page 36: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Features - Web Server - Jetty

Socket Server Web Server

Server Side

Page 37: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Features - Administration Tool - Profiling

Page 38: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Features - Administration Tool - Logging

Page 39: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Features - Administration Tool - Zone

Page 40: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Features - Administration Tool - Room

Page 41: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Features - Administration Tool - User

Page 42: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

On the other hand

Page 43: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Scalability - Bad Horizontal Scalability HTTP Diagram

SFS Diagram

STICKY SESSION

Page 44: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

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

Page 45: Real-time applications with sockets and websockets. Introduction to Smartfoxserver 2x

Thanks

www.cooldeveloper.xyz