Classes
Protocols
Constants
Functions
Macros
Types
Variables

### Classes

IRCObject
LineObject
NetApplication
TCPConnecting
TCPPort
TCPSystem
TCPTransport

### Protocols

<NetObject>
<NetPort>
<NetTransport>
<RunLoopEvents>
<TCPConnecting>

### Constants

### Functions

ExtractIRCHost
ExtractIRCNick
SeparateIRCNickAndHost

### Macros

### Types

RunLoopEventType

### Variables

ERR_ALREADYREGISTRED
ERR_BADCHANMASK
ERR_BADCHANNELKEY
ERR_BADMASK
ERR_BANLISTFULL
ERR_BANNEDFROMCHAN
ERR_CANNOTSENDTOCHAN
ERR_CANTKILLSERVER
ERR_CHANNELISFULL
ERR_CHANOPRIVSNEEDED
ERR_ERRONEUSNICKNAME
ERR_FILEERROR
ERR_INVITEONLYCHAN
ERR_KEYSET
ERR_NEEDMOREPARAMS
ERR_NICKCOLLISION
ERR_NICKNAMEINUSE
ERR_NOADMININFO
ERR_NOCHANMODES
ERR_NOLOGIN
ERR_NOMOTD
ERR_NONICKNAMEGIVEN
ERR_NOOPERHOST
ERR_NOORIGIN
ERR_NOPERMFORHOST
ERR_NOPRIVILEGES
ERR_NORECIPIENT
ERR_NOSERVICEHOST
ERR_NOSUCHCHANNEL
ERR_NOSUCHNICK
ERR_NOSUCHSERVER
ERR_NOSUCHSERVICE
ERR_NOTEXTTOSEND
ERR_NOTONCHANNEL
ERR_NOTOPLEVEL
ERR_NOTREGISTERED
ERR_PASSWDMISMATCH
ERR_RESTRICTED
ERR_SUMMONDISABLED
ERR_TOOMANYCHANNELS
ERR_TOOMANYTARGETS
ERR_UMODEUNKNOWNFLAG
ERR_UNAVAILRESOURCE
ERR_UNIQOPPRIVSNEEDED
ERR_UNKNOWNCOMMAND
ERR_UNKNOWNMODE
ERR_USERNOTINCHANNEL
ERR_USERONCHANNEL
ERR_USERSDISABLED
ERR_USERSDONTMATCH
ERR_WASNOSUCHNICK
ERR_WILDTOPLEVEL
ERR_YOUREBANNEDCREEP
ERR_YOUWILLBEBANNED
FatalNetException
IRCException
NetException
NetclassesErrorAborted
NetclassesErrorBadAddress
NetclassesErrorTimeout
RPL_ADMINEMAIL
RPL_ADMINLOC1
RPL_ADMINLOC2
RPL_ADMINME
RPL_AWAY
RPL_BANLIST
RPL_BOUNCE
RPL_CHANNELMODEIS
RPL_CLOSEEND
RPL_CLOSING
RPL_CREATED
RPL_ENDOFBANLIST
RPL_ENDOFEXCEPTLIST
RPL_ENDOFINFO
RPL_ENDOFINVITELIST
RPL_ENDOFLINKS
RPL_ENDOFMOTD
RPL_ENDOFNAMES
RPL_ENDOFSERVICES
RPL_ENDOFSTATS
RPL_ENDOFUSERS
RPL_ENDOFWHO
RPL_ENDOFWHOIS
RPL_ENDOFWHOWAS
RPL_EXCEPTLIST
RPL_INFO
RPL_INFOSTART
RPL_INVITELIST
RPL_INVITING
RPL_ISON
RPL_ISUPPORT
RPL_KILLDONE
RPL_LINKS
RPL_LIST
RPL_LISTEND
RPL_LISTSTART
RPL_LUSERCHANNELS
RPL_LUSERCLIENT
RPL_LUSERME
RPL_LUSEROP
RPL_LUSERUNKNOWN
RPL_MOTD
RPL_MOTDSTART
RPL_MYINFO
RPL_MYPORTIS
RPL_NAMREPLY
RPL_NONE
RPL_NOTOPIC
RPL_NOUSERS
RPL_NOWAWAY
RPL_REHASHING
RPL_SERVICE
RPL_SERVICEINFO
RPL_SERVLIST
RPL_SERVLISTEND
RPL_STATSBLINE
RPL_STATSCLINE
RPL_STATSCOMMANDS
RPL_STATSDLINE
RPL_STATSHLINE
RPL_STATSILINE
RPL_STATSKLINE
RPL_STATSLINKINFO
RPL_STATSLLINE
RPL_STATSNLINE
RPL_STATSOLINE
RPL_STATSPING
RPL_STATSQLINE
RPL_STATSSLINE
RPL_STATSUPTIME
RPL_STATSVLINE
RPL_STATSYLINE
RPL_SUMMONING
RPL_TIME
RPL_TOPIC
RPL_TRACECLASS
RPL_TRACECONNECTING
RPL_TRACEEND
RPL_TRACEHANDSHAKE
RPL_TRACELINK
RPL_TRACELOG
RPL_TRACENEWTYPE
RPL_TRACEOPERATOR
RPL_TRACERECONNECT
RPL_TRACESERVER
RPL_TRACESERVICE
RPL_TRACEUNKNOWN
RPL_TRACEUSER
RPL_TRYAGAIN
RPL_UMODEIS
RPL_UNAWAY
RPL_UNIQOPIS
RPL_USERHOST
RPL_USERS
RPL_USERSSTART
RPL_VERSION
RPL_WELCOME
RPL_WHOISCHANNELS
RPL_WHOISCHANOP
RPL_WHOISIDLE
RPL_WHOISOPERATOR
RPL_WHOISSERVER
RPL_WHOISUSER
RPL_WHOREPLY
RPL_WHOWASUSER
RPL_YOUREOPER
RPL_YOURESERVICE
RPL_YOURHOST

Up

# Using netclasses synchronously

### Authors

Andrew Ruder (`aeruder@ksu.edu`)

Version: Revision 1

Date: July 7, 2005

> How to use netclasses synchronously.

Copyright: (C) Andrew Ruder

### Contents -

1. Introduction
2. Ensure that Asynchronous Mode is Off
3. Writing synchronously
4. Reading synchronously

# Introduction

While netclasses is primarily for asynchronous connections, it can somewhat easily be used for synchronous connections as well.

This is primarily done by directly calling the -[id<NetTransport> writeData:] and -[id<NetTransport> readData:] methods on the appropriate transport. This must be done while the object is not being handled by NetApplication .

# Ensure that Asynchronous Mode is Off

The first thing to worry about is that the object is not being handled asynchronously by NetApplication . To ensure that this is the case, -[NetApplication disconnectObject:] should be called with the object we are interested in as the argument. This will remove it from the netclasses runloop. At this point, the object is ready to be written to and read from synchronously.

# Writing synchronously

After disabling asynchronous mode, you can easily write any data you want to the transport using the -[id<NetTransport> writeData:] method with a NSData as the argument. However, none of the data is actually written out. To force the write out of the data, pass a 'nil' argument to -[id<NetTransport> writeData:] . To see if there is more data, use the -[id<NetTransport> isDoneWriting] method on the transport.

# Reading synchronously

After disabling asynchronous mode, you can easily read data from the transport using the -[id<NetTransport> readData:] method. This method takes a single argument of the maximum number of bytes to read. Passing 0 will cause as much data as is available to be read.

Up