#import <TCPListener.h>
Inherited by BLIPEchoServer, and BLIPTestListener.
All are optional except -listener:didAcceptConnection:.
Public Member Functions | |
| (void) | - listener:didAcceptConnection: |
| Called after an incoming connection arrives and is opened; the connection is now ready to send and receive data. | |
| (void) | - listenerDidOpen: |
| Called after the listener successfully opens. | |
| (void) | - listener:failedToOpen: |
| Called if the listener fails to open due to an error. | |
| (void) | - listenerDidClose: |
| Called after the listener closes. | |
| (BOOL) | - listener:shouldAcceptConnectionFrom: |
| Called when an incoming connection request arrives, but before the conncetion is opened; return YES to accept the connection, NO to refuse it. | |
| - (void) listener: | (TCPListener *) | listener | ||
| didAcceptConnection: | (TCPConnection *) | connection | ||
Called after an incoming connection arrives and is opened; the connection is now ready to send and receive data.
To control whether or not a connection should be accepted, implement the -listener:shouldAcceptConnectionFrom: method. To use a different class than TCPConnection, set the listener's -connectionClass property. (This is the only required delegate method; the others are optional to implement.)
| - (void) listenerDidOpen: | (TCPListener *) | listener |
Called after the listener successfully opens.
| - (void) listener: | (TCPListener *) | listener | ||
| failedToOpen: | (NSError *) | error | ||
Called if the listener fails to open due to an error.
| - (void) listenerDidClose: | (TCPListener *) | listener |
Called after the listener closes.
| - (BOOL) listener: | (TCPListener *) | listener | ||
| shouldAcceptConnectionFrom: | (IPAddress *) | address | ||
Called when an incoming connection request arrives, but before the conncetion is opened; return YES to accept the connection, NO to refuse it.
This method can only use criteria like the peer IP address, or the number of currently open connections, to determine whether to accept. If you also want to check the peer's SSL certificate, then return YES from this method, and use the TCPConnection delegate method -connection:authorizeSSLPeer: to examine the certificate.
1.5.4