cleanup comments and remove dead code

This commit is contained in:
Andy Prock 2016-01-02 11:01:03 -08:00
parent 64afa9b677
commit 6bb767545e
2 changed files with 15 additions and 20 deletions

View File

@ -57,16 +57,29 @@ typedef enum RCTTCPError RCTTCPError;
/// @name Instance Methods
///---------------------------------------------------------------------------------------
/**
* Binds to a host and port
* Connects to a host and port
*
* @param port
* @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;
/**
* 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;
/**
* Returns the address information
*
* @return NSDictionary with @"address" host, @"port" port, @"family" IPv4/IPv6
*/
- (NSDictionary<NSString *, id> *)getAddress;
/**

View File

@ -230,15 +230,6 @@ NSString *const RCTTCPErrorDomain = @"RCTTCPErrorDomain";
[_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
{
NSDictionary *userInfo = [NSDictionary dictionaryWithObject:errMsg forKey:NSLocalizedDescriptionKey];
@ -248,15 +239,6 @@ NSString *const RCTTCPErrorDomain = @"RCTTCPErrorDomain";
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
{
return dispatch_get_main_queue();