IRCConnection: Make the socket class configurable
This makes using TLS possible. FossilOrigin-Name: 38de3de8ed2056e1116492cc44443d814ff115d85b81ba5c9014d0bf925a0f83
This commit is contained in:
parent
47e0929527
commit
21784a8d30
2 changed files with 13 additions and 2 deletions
|
@ -38,6 +38,7 @@
|
|||
#import "IRCUser.h"
|
||||
|
||||
@implementation IRCConnection
|
||||
@synthesize socketClass = _socketClass;
|
||||
@synthesize server = _server, port = _port;
|
||||
@synthesize nickname = _nickname, username = _username, realname = _realname;
|
||||
@synthesize delegate = _delegate, socket = _socket;
|
||||
|
@ -52,6 +53,7 @@
|
|||
self = [super init];
|
||||
|
||||
@try {
|
||||
_socketClass = [OFTCPSocket class];
|
||||
_channels = [[OFMutableDictionary alloc] init];
|
||||
_port = 6667;
|
||||
} @catch (id e) {
|
||||
|
@ -81,7 +83,12 @@
|
|||
if (_socket != nil)
|
||||
@throw [OFAlreadyConnectedException exception];
|
||||
|
||||
_socket = [[OFTCPSocket alloc] init];
|
||||
_socket = [[_socketClass alloc] init];
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(connection:didCreateSocket:)])
|
||||
[_delegate connection: self
|
||||
didCreateSocket: _socket];
|
||||
|
||||
[_socket connectToHost: _server
|
||||
port: _port];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue