FMLiveSwitchVirtualTcpSocket Class Reference

Instance Methods

(FMLiveSwitchStreamSocket *) - accept
 
(void) - acceptAsyncWithOnSuccess:onFailure:onSocket:
 Accepts a new socket asynchronously. More...
 
(void) - acceptAsyncWithOnSuccessBlock:onFailureBlock:onSocketBlock:
 Accepts a new socket asynchronously. More...
 
(FMLiveSwitchStreamSocket *) - acceptAsyncWithOnSuccessBlockAndOnFailureBlockAndOnSocketBlock
 Accepts a new socket asynchronously. More...
 
(FMLiveSwitchStreamSocket *) - acceptWithTimeout:
 
(bool) - bind
 
(bool) - bindWithAddressInUse:
 
(bool) - bindWithIPAddress:
 
(bool) - bindWithIPAddress:addressInUse:
 
(bool) - bindWithIPAddress:port:
 
(bool) - bindWithIPAddress:port:addressInUse:
 Binds the socket to a local endpoint. More...
 
(bool) - bindWithPort:
 
(bool) - bindWithPort:addressInUse:
 
(void) - close
 Closes the socket. More...
 
(void) - connectAsyncWithHostname:ipAddress:port:timeout:onSuccess:onFailure:
 Connects the socket asynchronously. More...
 
(void) - connectAsyncWithHostname:ipAddress:port:timeout:onSuccessBlock:onFailureBlock:
 Connects the socket asynchronously. More...
 
(NSException *, bool) - connectAsyncWithHostnameAndIPAddressAndPortAndTimeoutAndOnSuccessBlockAndOnFailureBlock
 Connects the socket asynchronously. More...
 
(bool) - connectWithHostname:ipAddress:port:timeout:
 
(NSString *) - description
 
(instancetype) - initWithAdapter:server:ipv6:secure:
 
(bool) - ipv6
 Gets a value indicating whether the socket supports IPv6. More...
 
(bool) - isClosed
 Gets a value indicating whether this instance is closed. More...
 
(NSString *) - localHostname
 
(NSString *) - localIPAddress
 Gets the local IP address. More...
 
(int) - localPort
 Gets the local port. More...
 
(FMLiveSwitchVirtualPacket *) - receive
 
(void) - receiveAsyncWithTimeout:
 Receives data asynchronously. More...
 
(FMLiveSwitchVirtualPacket *) - receiveWithTimeout:
 
(NSString *) - remoteHostname
 Gets the remote hostname. More...
 
(NSString *) - remoteIPAddress
 Gets the remote IP address. More...
 
(int) - remotePort
 Gets the remote port. More...
 
(bool) - secure
 Gets a value indicating whether the socket is secure. More...
 
(void) - sendAsyncWithBuffer:timeout:onSuccess:onFailure:
 Sends data asynchronously. More...
 
(void) - sendAsyncWithBuffer:timeout:onSuccessBlock:onFailureBlock:
 Sends data asynchronously. More...
 
(NSException *, bool) - sendAsyncWithBufferAndTimeoutAndOnSuccessBlockAndOnFailureBlock
 Sends data asynchronously. More...
 
(int) - sendDelay
 
(bool) - sendWithBuffer:
 Sends data synchronously. More...
 
(bool) - sendWithBuffer:timeout:
 
(bool) - server
 Gets a value indicating whether the socket can accept incoming connections. More...
 
(void) - setLocalHostname:
 
(void) - setSendDelay:
 
- Instance Methods inherited from FMLiveSwitchStreamSocket
(instancetype) - init
 
(FMLiveSwitchAction2< NSException *, id > *) - onReceiveFailure
 Gets a callback invoked on failed read from TCP stream. More...
 
(FMLiveSwitchAction1< FMLiveSwitchDataBuffer * > *) - onReceiveSuccess
 Gets a callback invoked on successful read from TCP stream. More...
 
(void) - raiseAcceptFailureWithCallback:exception:
 Invokes the accept failure callback. More...
 
(void) - raiseAcceptFailureWithCallbackBlock:exception:
 Invokes the accept failure callback. More...
 
(NSException *) - raiseAcceptFailureWithCallbackBlockAndException
 Invokes the accept failure callback. More...
 
(void) - raiseAcceptSocketWithCallback:socket:
 Invokes the accept success callback. More...
 
(void) - raiseAcceptSocketWithCallbackBlock:socket:
 Invokes the accept success callback. More...
 
(FMLiveSwitchStreamSocket *) - raiseAcceptSocketWithCallbackBlockAndSocket
 Invokes the accept success callback. More...
 
(void) - raiseAcceptSuccessWithCallback:
 Invokes the accept success callback. More...
 
(void) - raiseConnectFailureWithCallback:exception:timedOut:
 Invokes the connect failure callback. More...
 
(void) - raiseConnectFailureWithCallbackBlock:exception:timedOut:
 Invokes the connect failure callback. More...
 
(NSException *, bool) - raiseConnectFailureWithCallbackBlockAndExceptionAndTimedOut
 Invokes the connect failure callback. More...
 
(void) - raiseConnectSuccessWithCallback:
 Invokes the connect success callback. More...
 
(void) - raiseReceiveFailureWithCallback:exception:timedOut:
 Invokes the receive failure callback. More...
 
(void) - raiseReceiveFailureWithCallbackBlock:exception:timedOut:
 Invokes the receive failure callback. More...
 
(NSException *, bool) - raiseReceiveFailureWithCallbackBlockAndExceptionAndTimedOut
 Invokes the receive failure callback. More...
 
(void) - raiseReceiveSuccessWithCallback:buffer:
 Invokes the receive success callback. More...
 
(void) - raiseReceiveSuccessWithCallbackBlock:buffer:
 Invokes the receive success callback. More...
 
(FMLiveSwitchDataBuffer *) - raiseReceiveSuccessWithCallbackBlockAndBuffer
 Invokes the receive success callback. More...
 
(void) - raiseSendFailureWithCallback:exception:timedOut:
 Invokes the send failure callback. More...
 
(void) - raiseSendFailureWithCallbackBlock:exception:timedOut:
 Invokes the send failure callback. More...
 
(NSException *, bool) - raiseSendFailureWithCallbackBlockAndExceptionAndTimedOut
 Invokes the send failure callback. More...
 
(void) - raiseSendSuccessWithCallback:
 Invokes the send success callback. More...
 
(void) - setOnReceiveFailure:
 Sets a callback invoked on failed read from TCP stream. More...
 
(NSException *, bool) - setOnReceiveFailureBlock
 Sets a callback invoked on failed read from TCP stream. More...
 
(void) - setOnReceiveFailureBlock:
 Sets a callback invoked on failed read from TCP stream. More...
 
(void) - setOnReceiveSuccess:
 Sets a callback invoked on successful read from TCP stream. More...
 
(FMLiveSwitchDataBuffer *) - setOnReceiveSuccessBlock
 Sets a callback invoked on successful read from TCP stream. More...
 
(void) - setOnReceiveSuccessBlock:
 Sets a callback invoked on successful read from TCP stream. More...
 
- Instance Methods inherited from FMLiveSwitchManagedSocket
(long long) - adapterSpeed
 Gets the adapter speed. More...
 
(NSMutableArray *) - publicIPAddresses
 Gets the public IP addresses, if known. More...
 
(void) - setAdapterSpeed:
 Sets the adapter speed. More...
 
(void) - setPublicIPAddresses:
 Sets the public IP addresses, if known. More...
 

Class Methods

(FMLiveSwitchVirtualTcpSocket *) + tcpSocketWithAdapter:server:ipv6:secure:
 
- Class Methods inherited from FMLiveSwitchStreamSocket
(FMLiveSwitchStreamSocket *) + streamSocket
 
- Class Methods inherited from FMLiveSwitchManagedSocket
(FMLiveSwitchManagedSocket *) + managedSocket
 

Method Documentation

◆ accept

◆ acceptAsyncWithOnSuccess:onFailure:onSocket:

- (void) acceptAsyncWithOnSuccess: (FMLiveSwitchAction0 *)  onSuccess
onFailure: (FMLiveSwitchAction1< NSException * > *)  onFailure
onSocket: (FMLiveSwitchAction1< FMLiveSwitchStreamSocket * > *)  onSocket 

Accepts a new socket asynchronously.

Parameters
onSuccessThe callback to invoke on success.
onFailureThe callback to invoke on failure.
onSocketThe callback to invoke when a socket is ready.

Implements FMLiveSwitchStreamSocket.

◆ acceptAsyncWithOnSuccessBlock:onFailureBlock:onSocketBlock:

- (void) acceptAsyncWithOnSuccessBlock: (void(^)(void))  onSuccessBlock
onFailureBlock: (void(^)(NSException *))  onFailureBlock
onSocketBlock: (void(^)(FMLiveSwitchStreamSocket *))  onSocketBlock 

Accepts a new socket asynchronously.

Parameters
onSuccessBlockThe callback to invoke on success.
onFailureBlockThe callback to invoke on failure.
onSocketBlockThe callback to invoke when a socket is ready.

Implements FMLiveSwitchStreamSocket.

◆ acceptAsyncWithOnSuccessBlockAndOnFailureBlockAndOnSocketBlock

- (FMLiveSwitchStreamSocket*) acceptAsyncWithOnSuccessBlockAndOnFailureBlockAndOnSocketBlock

Accepts a new socket asynchronously.

@inlineparam onSuccessBlock The callback to invoke on success. @inlineparam onFailureBlock The callback to invoke on failure. @inlineparam onSocketBlock The callback to invoke when a socket is ready.

Implements FMLiveSwitchStreamSocket.

◆ acceptWithTimeout:

- (FMLiveSwitchStreamSocket*) acceptWithTimeout: (int)  timeout

◆ bind

- (bool) bind

◆ bindWithAddressInUse:

- (bool) bindWithAddressInUse: (bool *)  addressInUse

◆ bindWithIPAddress:

- (bool) bindWithIPAddress: (NSString *)  ipAddress

◆ bindWithIPAddress:addressInUse:

- (bool) bindWithIPAddress: (NSString *)  ipAddress
addressInUse: (bool *)  addressInUse 

◆ bindWithIPAddress:port:

- (bool) bindWithIPAddress: (NSString *)  ipAddress
port: (int)  port 

◆ bindWithIPAddress:port:addressInUse:

- (bool) bindWithIPAddress: (NSString *)  ipAddress
port: (int)  port
addressInUse: (bool *)  addressInUse 

Binds the socket to a local endpoint.

Parameters
ipAddressThe local IP address.
portThe local port.
addressInUseIndicates that access to the address is forbidden or in use.

Implements FMLiveSwitchManagedSocket.

◆ bindWithPort:

- (bool) bindWithPort: (int)  port

◆ bindWithPort:addressInUse:

- (bool) bindWithPort: (int)  port
addressInUse: (bool *)  addressInUse 

◆ close

- (void) close

Closes the socket.

Implements FMLiveSwitchManagedSocket.

◆ connectAsyncWithHostname:ipAddress:port:timeout:onSuccess:onFailure:

- (void) connectAsyncWithHostname: (NSString *)  hostname
ipAddress: (NSString *)  ipAddress
port: (int)  port
timeout: (int)  timeout
onSuccess: (FMLiveSwitchAction0 *)  onSuccess
onFailure: (FMLiveSwitchAction2< NSException *, id > *)  onFailure 

Connects the socket asynchronously.

Parameters
hostnameThe remote hostname.
ipAddressThe remote IP address.
portThe remote port.
timeoutThe timeout (in ms).
onSuccessThe callback to invoke on success.
onFailureThe callback to invoke on failure.

Implements FMLiveSwitchStreamSocket.

◆ connectAsyncWithHostname:ipAddress:port:timeout:onSuccessBlock:onFailureBlock:

- (void) connectAsyncWithHostname: (NSString *)  hostname
ipAddress: (NSString *)  ipAddress
port: (int)  port
timeout: (int)  timeout
onSuccessBlock: (void(^)(void))  onSuccessBlock
onFailureBlock: (void(^)(NSException *, bool))  onFailureBlock 

Connects the socket asynchronously.

Parameters
hostnameThe remote hostname.
ipAddressThe remote IP address.
portThe remote port.
timeoutThe timeout (in ms).
onSuccessBlockThe callback to invoke on success.
onFailureBlockThe callback to invoke on failure.

Implements FMLiveSwitchStreamSocket.

◆ connectAsyncWithHostnameAndIPAddressAndPortAndTimeoutAndOnSuccessBlockAndOnFailureBlock

- (NSException*, bool) connectAsyncWithHostnameAndIPAddressAndPortAndTimeoutAndOnSuccessBlockAndOnFailureBlock

Connects the socket asynchronously.

@inlineparam hostname The remote hostname. @inlineparam ipAddress The remote IP address. @inlineparam port The remote port. @inlineparam timeout The timeout (in ms). @inlineparam onSuccessBlock The callback to invoke on success. @inlineparam onFailureBlock The callback to invoke on failure.

Implements FMLiveSwitchStreamSocket.

◆ connectWithHostname:ipAddress:port:timeout:

- (bool) connectWithHostname: (NSString *)  hostname
ipAddress: (NSString *)  ipAddress
port: (int)  port
timeout: (int)  timeout 

◆ description

- (NSString*) description

◆ initWithAdapter:server:ipv6:secure:

- (instancetype) initWithAdapter: (FMLiveSwitchVirtualAdapter *)  adapter
server: (bool)  server
ipv6: (bool)  ipv6
secure: (bool)  secure 

◆ ipv6

- (bool) ipv6

Gets a value indicating whether the socket supports IPv6.

Implements FMLiveSwitchManagedSocket.

◆ isClosed

- (bool) isClosed

Gets a value indicating whether this instance is closed.

Implements FMLiveSwitchManagedSocket.

◆ localHostname

- (NSString*) localHostname

◆ localIPAddress

- (NSString*) localIPAddress

Gets the local IP address.

Implements FMLiveSwitchManagedSocket.

◆ localPort

- (int) localPort

Gets the local port.

Implements FMLiveSwitchManagedSocket.

◆ receive

◆ receiveAsyncWithTimeout:

- (void) receiveAsyncWithTimeout: (int)  timeout

Receives data asynchronously.

Parameters
timeoutThe timeout (in ms).

Implements FMLiveSwitchStreamSocket.

◆ receiveWithTimeout:

- (FMLiveSwitchVirtualPacket*) receiveWithTimeout: (int)  timeout

◆ remoteHostname

- (NSString*) remoteHostname

Gets the remote hostname.

Implements FMLiveSwitchStreamSocket.

◆ remoteIPAddress

- (NSString*) remoteIPAddress

Gets the remote IP address.

Implements FMLiveSwitchStreamSocket.

◆ remotePort

- (int) remotePort

Gets the remote port.

Implements FMLiveSwitchStreamSocket.

◆ secure

- (bool) secure

Gets a value indicating whether the socket is secure.

Implements FMLiveSwitchStreamSocket.

◆ sendAsyncWithBuffer:timeout:onSuccess:onFailure:

- (void) sendAsyncWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
timeout: (int)  timeout
onSuccess: (FMLiveSwitchAction0 *)  onSuccess
onFailure: (FMLiveSwitchAction2< NSException *, id > *)  onFailure 

Sends data asynchronously.

Parameters
bufferThe buffer.
timeoutThe timeout (in ms).
onSuccessThe callback to invoke on success.
onFailureThe callback to invoke on failure.

Implements FMLiveSwitchStreamSocket.

◆ sendAsyncWithBuffer:timeout:onSuccessBlock:onFailureBlock:

- (void) sendAsyncWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
timeout: (int)  timeout
onSuccessBlock: (void(^)(void))  onSuccessBlock
onFailureBlock: (void(^)(NSException *, bool))  onFailureBlock 

Sends data asynchronously.

Parameters
bufferThe buffer.
timeoutThe timeout (in ms).
onSuccessBlockThe callback to invoke on success.
onFailureBlockThe callback to invoke on failure.

Implements FMLiveSwitchStreamSocket.

◆ sendAsyncWithBufferAndTimeoutAndOnSuccessBlockAndOnFailureBlock

- (NSException*, bool) sendAsyncWithBufferAndTimeoutAndOnSuccessBlockAndOnFailureBlock

Sends data asynchronously.

@inlineparam buffer The buffer. @inlineparam timeout The timeout (in ms). @inlineparam onSuccessBlock The callback to invoke on success. @inlineparam onFailureBlock The callback to invoke on failure.

Implements FMLiveSwitchStreamSocket.

◆ sendDelay

- (int) sendDelay

◆ sendWithBuffer:

- (bool) sendWithBuffer: (FMLiveSwitchDataBuffer *)  buffer

Sends data synchronously.

Parameters
bufferThe buffer.

Implements FMLiveSwitchStreamSocket.

◆ sendWithBuffer:timeout:

- (bool) sendWithBuffer: (FMLiveSwitchDataBuffer *)  buffer
timeout: (int)  timeout 

◆ server

- (bool) server

Gets a value indicating whether the socket can accept incoming connections.

Implements FMLiveSwitchStreamSocket.

◆ setLocalHostname:

- (void) setLocalHostname: (NSString *)  value

◆ setSendDelay:

- (void) setSendDelay: (int)  value

◆ tcpSocketWithAdapter:server:ipv6:secure:

+ (FMLiveSwitchVirtualTcpSocket*) tcpSocketWithAdapter: (FMLiveSwitchVirtualAdapter *)  adapter
server: (bool)  server
ipv6: (bool)  ipv6
secure: (bool)  secure