mirror of
https://github.com/status-im/react-native-tcp.git
synced 2025-02-28 18:00:30 +00:00
cleanup comments and remove dead code
This commit is contained in:
parent
64afa9b677
commit
6bb767545e
@ -57,16 +57,29 @@ typedef enum RCTTCPError RCTTCPError;
|
|||||||
/// @name Instance Methods
|
/// @name Instance Methods
|
||||||
///---------------------------------------------------------------------------------------
|
///---------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Binds to a host and port
|
* Connects to a host and port
|
||||||
*
|
*
|
||||||
* @param port
|
* @param port
|
||||||
* @param host ip address
|
* @param host ip address
|
||||||
* @return true if bound, false if there was an error
|
* @param options NSDictionary which can have @"localAddress" and @"localPort" to specify the local interface
|
||||||
|
* @return true if connected, false if there was an error
|
||||||
*/
|
*/
|
||||||
- (BOOL)connect:(NSString *)host port:(int)port withOptions:(NSDictionary *)options error:(NSError **)error;
|
- (BOOL)connect:(NSString *)host port:(int)port withOptions:(NSDictionary *)options error:(NSError **)error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts listening on a local host and port
|
||||||
|
*
|
||||||
|
* @param local ip address
|
||||||
|
* @param local port
|
||||||
|
* @return true if connected, false if there was an error
|
||||||
|
*/
|
||||||
- (BOOL)listen:(NSString *)host port:(int)port error:(NSError **)error;
|
- (BOOL)listen:(NSString *)host port:(int)port error:(NSError **)error;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the address information
|
||||||
|
*
|
||||||
|
* @return NSDictionary with @"address" host, @"port" port, @"family" IPv4/IPv6
|
||||||
|
*/
|
||||||
- (NSDictionary<NSString *, id> *)getAddress;
|
- (NSDictionary<NSString *, id> *)getAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -230,15 +230,6 @@ NSString *const RCTTCPErrorDomain = @"RCTTCPErrorDomain";
|
|||||||
[_clientDelegate onClose:self withError:(!err || err.code == GCDAsyncSocketClosedError ? nil : err)];
|
[_clientDelegate onClose:self withError:(!err || err.code == GCDAsyncSocketClosedError ? nil : err)];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSError *)badParamError:(NSString *)errMsg
|
|
||||||
{
|
|
||||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:errMsg forKey:NSLocalizedDescriptionKey];
|
|
||||||
|
|
||||||
return [NSError errorWithDomain:RCTTCPErrorDomain
|
|
||||||
code:RCTTCPBadParamError
|
|
||||||
userInfo:userInfo];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSError *)badInvocationError:(NSString *)errMsg
|
- (NSError *)badInvocationError:(NSString *)errMsg
|
||||||
{
|
{
|
||||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:errMsg forKey:NSLocalizedDescriptionKey];
|
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:errMsg forKey:NSLocalizedDescriptionKey];
|
||||||
@ -248,15 +239,6 @@ NSString *const RCTTCPErrorDomain = @"RCTTCPErrorDomain";
|
|||||||
userInfo:userInfo];
|
userInfo:userInfo];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSError *)sendFailedError:(NSString *)errMsg
|
|
||||||
{
|
|
||||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:errMsg forKey:NSLocalizedDescriptionKey];
|
|
||||||
|
|
||||||
return [NSError errorWithDomain:RCTTCPErrorDomain
|
|
||||||
code:RCTTCPSendFailedError
|
|
||||||
userInfo:userInfo];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (dispatch_queue_t)methodQueue
|
- (dispatch_queue_t)methodQueue
|
||||||
{
|
{
|
||||||
return dispatch_get_main_queue();
|
return dispatch_get_main_queue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user