Differences From Artifact [12ead9fa2b]:
- File src/IRCConnection.m — part of check-in [fc04e870e4] at 2017-01-10 00:58:02 on branch trunk — Fix channel iteration in QUIT handler (user: js, size: 14978) [annotate] [blame] [check-ins using]
To Artifact [6579a2f540]:
- File
src/IRCConnection.m
— part of check-in
[38de3de8ed]
at
2017-01-22 17:24:18
on branch trunk
— IRCConnection: Make the socket class configurable
This makes using TLS possible. (user: js, size: 15205) [annotate] [blame] [check-ins using]
︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + + | #import <ObjFW/macros.h> #import "IRCConnection.h" #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; + (instancetype)connection { return [[[self alloc] init] autorelease]; } - init { self = [super init]; @try { _socketClass = [OFTCPSocket class]; _channels = [[OFMutableDictionary alloc] init]; _port = 6667; } @catch (id e) { [self release]; @throw e; } |
︙ | |||
77 78 79 80 81 82 83 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | + + + + + - + | - (void)connect { void *pool = objc_autoreleasePoolPush(); if (_socket != nil) @throw [OFAlreadyConnectedException exception]; _socket = [[_socketClass alloc] init]; if ([_delegate respondsToSelector: @selector(connection:didCreateSocket:)]) [_delegate connection: self didCreateSocket: _socket]; |
︙ |