Overview
Comment: | IRCConnection: Make the socket class configurable
This makes using TLS possible. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
38de3de8ed2056e1116492cc44443d81 |
User & Date: | js on 2017-01-22 17:24:18 |
Other Links: | manifest | tags |
Context
2017-01-22
| ||
20:49 | IRCConnection: Make fallback encoding configurable check-in: 0ca6e4f04d user: js tags: trunk | |
17:24 | IRCConnection: Make the socket class configurable check-in: 38de3de8ed user: js tags: trunk | |
15:20 | Do not run tests automatically check-in: 9a8a6a9bf9 user: js tags: trunk | |
Changes
Modified src/IRCConnection.h from [a68be5271e] to [de62d2cefb].
︙ | |||
25 26 27 28 29 30 31 32 33 34 35 36 37 38 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | + + | @class IRCConnection; @class IRCUser; @protocol IRCConnectionDelegate <OFObject> @optional - (void)connection: (IRCConnection*)connection didCreateSocket: (OF_KINDOF(OFTCPSocket)*)socket; - (void)connection: (IRCConnection*)connection didReceiveLine: (OFString*)line; - (void)connection: (IRCConnection*)connection didSendLine: (OFString*)line; - (void)connectionWasEstablished: (IRCConnection*)connection; - (void)connection: (IRCConnection*)connection didSeeUser: (IRCUser*)user joinChannel: (OFString*)channel; |
︙ | |||
68 69 70 71 72 73 74 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | + - + + | - (void)connection: (IRCConnection*)connection didReceiveNamesForChannel: (OFString*)channel; - (void)connectionWasClosed: (IRCConnection*)connection; @end @interface IRCConnection: OFObject { Class _socketClass; |
︙ |
Modified src/IRCConnection.m from [12ead9fa2b] to [6579a2f540].
︙ | |||
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]; |
︙ |