Handle closed connection.
FossilOrigin-Name: 4314708767bfb9f430a5e700e471993aa26c2d7bf0289982d82840dd55564d53
This commit is contained in:
parent
9d8593a138
commit
a73f2c9daa
3 changed files with 13 additions and 0 deletions
|
@ -70,6 +70,7 @@
|
|||
inChannel: (IRCChannel*)channel;
|
||||
- (void)connection: (IRCConnection*)connection
|
||||
didReceiveNamesForChannel: (IRCChannel*)channel;
|
||||
- (void)connectionWasClosed: (IRCConnection*)connection;
|
||||
@end
|
||||
|
||||
@interface IRCConnection: OFObject
|
||||
|
|
|
@ -170,6 +170,14 @@
|
|||
OFArray *split;
|
||||
OFString *action = nil;
|
||||
|
||||
if (sock.atEndOfStream) {
|
||||
if ([delegate respondsToSelector:
|
||||
@selector(connectionWasClosed:)])
|
||||
[delegate connectionWasClosed: self];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@try {
|
||||
line = [sock tryReadLine];
|
||||
} @catch (OFInvalidEncodingException *e) {
|
||||
|
|
|
@ -3,3 +3,7 @@ all:
|
|||
|
||||
clean:
|
||||
rm -f *.o *.so *.dylib *.dll
|
||||
|
||||
install:
|
||||
cp *.h /usr/local/include/ObjIRC/
|
||||
cp libobjirc.dylib /usr/local/lib/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue