Handle closed connection.

FossilOrigin-Name: 4314708767bfb9f430a5e700e471993aa26c2d7bf0289982d82840dd55564d53
This commit is contained in:
Jonathan Schleifer 2012-02-16 14:56:10 +00:00
parent 9d8593a138
commit a73f2c9daa
3 changed files with 13 additions and 0 deletions

View file

@ -70,6 +70,7 @@
inChannel: (IRCChannel*)channel;
- (void)connection: (IRCConnection*)connection
didReceiveNamesForChannel: (IRCChannel*)channel;
- (void)connectionWasClosed: (IRCConnection*)connection;
@end
@interface IRCConnection: OFObject

View file

@ -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) {

View file

@ -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/