Package | org.samchon.protocol.socket |
Class | public class ServerConnector |
Inheritance | ServerConnector ![]() |
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.
Method | Defined By | ||
---|---|---|---|
ServerConnector(parent:IProtocol)
Construct from a window. | ServerConnector | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void [override] | ServerConnector | ||
ServerConnector | |||
Send Invoke message to the Server
| ServerConnector |
Method | Defined By | ||
---|---|---|---|
readString(byteArray:ByteArray):String | ServerConnector | ||
writeString(str:String):void | ServerConnector |
Constant | Defined By | ||
---|---|---|---|
CLOSED_PARENTHESIS_SIZE : int [static] | ServerConnector |
ServerConnector | () | Constructor |
public function ServerConnector(parent:IProtocol)
Construct from a window.
Parametersparent:IProtocol — A target object who will receive replied data from server
|
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 |
String |
replyData | () | method |
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 |
CLOSED_PARENTHESIS_SIZE | Constant |
protected static const CLOSED_PARENTHESIS_SIZE:int