Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (30 sloc) 0.985 kb
//
// CBAbstractClient.h
// CubicusDraw
//
// Created by James Potter on 26/02/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AsyncSocket.h"
#import "SBJson.h"
#import "CBHost.h"
/*
Used to identify async callbacks for reads/writes
*/
enum {
CBAbstractClientTagMessage
} CBAbstractClientTag;
@interface CBAbstractClient : NSObject<AsyncSocketDelegate>
- (id)initWithHost:(CBHost *)theHost;
- (void)connect;
// Helpers
- (void)sendMessage:(NSString *)type content:(id)obj;
- (void)sendMessage:(NSString *)type content:(id)obj tag:(long)tag;
- (void)readMessage; // non-blocking; actual data arrives in callback
@property (nonatomic, strong, readonly) CBHost *host;
@property (nonatomic, strong, readonly) AsyncSocket *socket;
@property (nonatomic, strong, readonly) SBJsonWriter *writer;
@property (nonatomic, strong, readonly) SBJsonParser *parser;
@property (nonatomic, assign) BOOL connected;
@end
Jump to Line
Something went wrong with that request. Please try again.