Packageorg.samchon.protocol.socket
Classpublic class ServerConnector
InheritanceServerConnector Inheritance flash.net.Socket
Implements IProtocol
Subclasses KRServerConnector

A server connector for a physical client.

ServerConnector is a class for a physical client connecting a server. If you want to connect to a server, then implements this ServerConnector and just override some methods like getIP(), getPort() and replyData(). That's all.

In Samchon Framework, package protocol, There are basic 3 + 1 components that can make any type of network system in Samchon Framework. The basic 3 components are IProtocol, IServer and IClient. The last, surplus one is the ServerConnector. Looking around classes in Samchon Framework, especially module master and slave which are designed for realizing distributed processing systems and parallel processing systems, physical client classes are all derived from this ServerConnector.



Public Methods
 MethodDefined By
  
Construct from a window.
ServerConnector
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[override]
ServerConnector
  
replyData(invoke:Invoke):void
ServerConnector
  
sendData(invoke:Invoke):void
Send Invoke message to the Server
ServerConnector
Protected Methods
 MethodDefined By
  
readString(byteArray:ByteArray):String
ServerConnector
  
writeString(str:String):void
ServerConnector
Protected Constants
 ConstantDefined By
  CLOSED_PARENTHESIS_SIZE : int
[static]
ServerConnector
Constructor Detail
ServerConnector()Constructor
public function ServerConnector(parent:IProtocol)

Construct from a window.

Parameters
parent:IProtocol — A target object who will receive replied data from server
Method Detail
addEventListener()method
override public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Parameters

type:String
 
listener:Function
 
useCapture:Boolean (default = false)
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = false)

readString()method 
protected function readString(byteArray:ByteArray):String

Parameters

byteArray:ByteArray

Returns
String
replyData()method 
public function replyData(invoke:Invoke):void

Parameters

invoke:Invoke

sendData()method 
public function sendData(invoke:Invoke):void

Send Invoke message to the Server

Parameters

invoke:Invoke — An Invoke message wants to send server

writeString()method 
protected function writeString(str:String):void

Parameters

str:String

Constant Detail
CLOSED_PARENTHESIS_SIZEConstant
protected static const CLOSED_PARENTHESIS_SIZE:int