session-ios/Signal/src/network/NetworkEndPoint.h
Craig Gidney ced4fc8947 Initial work to depend on external futures library instead of internal implementation
Still need to:
- Fix indentation
- Check for any FutureSource being returned instead of FutureSource.future
- Check for then: vs thenTry: mixups
- Check for main thread related issues
- Check for other exception catching issues
- Adjust directory layout
- Manual end-to-end testing
2014-08-20 08:08:32 -04:00

24 lines
1 KiB
Objective-C

#import <Foundation/Foundation.h>
#import "CollapsingFutures.h"
#import "StreamPair.h"
/// Describes a location to which you can connect and communicate.
@protocol NetworkEndPoint <NSObject>
/// Creates a pair of read/write streams to this end point.
-(StreamPair*) createStreamPair;
/// Invoked when a stream pair has opened (tcp handshake completed), but before it is necessary writable.
/// (The time to set any options on the stream.)
-(void) handleStreamsOpened:(StreamPair*)streamPair;
/// Invoked when a stream pair is ready for read/write.
/// (The time to authenticate certificates of a completed SSL connection.)
-(TOCFuture*) asyncHandleStreamsConnected:(StreamPair*)streamPair;
/// Resolves this general end point into underlying associated specific end points.
/// For example, a hostname+port end point resolves into one or more ip+port end points.
/// The asynchronous result has type Future(Array(NetworkEndPoint)).
-(TOCFuture*) asyncResolveToSpecificEndPointsUnlessCancelled:(TOCCancelToken*)unlessCancelledToken;
@end