Commit graph

9 commits

Author SHA1 Message Date
mccallum
25e3d6354b (bzero): New macro, to memset(); for FD_ZERO().
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1178 72102866-910b-0410-8b05-ffd578937521
1996-03-18 14:01:18 +00:00
mccallum
094f927f35 ([TcpInPort +newForReceivingFromPortNumber:]): Initialize _run_loops.
([TcpInPort -addToRunLoop:forMode:]): Use new _run_loops Bag.
([TcpInPort -removeFromRunLoop:forMode:]): Likewise.
([TcpInPort -_connectedOutPortInvalidated:]): Likewise.
([TcpInPort -_addClientOutPort:]): Likewise.
([TcpInPort -dealloc]): Release _run_loops.
([TcpOutPort -outPacketClass]): Method renamed from -packetClass.
([TcpOutPort +outPacketClass]): Likewise.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1136 72102866-910b-0410-8b05-ffd578937521
1996-03-13 02:38:16 +00:00
mccallum
14e9a570a6 Updated to conform to new Port class. TcpPacket class split into
TcpInPacket and TcpOutPacket.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1121 72102866-910b-0410-8b05-ffd578937521
1996-03-12 19:43:25 +00:00
mccallum
a61ae3ccbf ([TcpInPort -receivePacketWithTimeout:]): Completely new
implementation that uses the RunLoop.
([TcpInPort -old_receivePacketWithTimeout:]): New method, holding old
implementation.
([TcpInPort -invokeWithObject:]): New method, called by RunLoop.
([TcpInPort -_tryToGetPacketFromReadableFD:]): New private method.
([TcpInPort -_addClientOutPort:toRunLoop:forMode:]): New method.
([TcpInPort -addToRunLoop:forMode:]): New method.
([TcpInPort -_removeClientOutPort:fromRunLoop:forMode:]): New method.
([TcpInPort -removeFromRunLoop:forMode:]): New method.
([TcpInPort -_addClientOutPort:]): Add it to the RunLoop.
([TcpInPort -_connectedOutPortInvalidated:]): Remove it from the
RunLoop.
([TcpInPort -_addClientOutPort:]): Method renamed from _addOutPort:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1107 72102866-910b-0410-8b05-ffd578937521
1996-03-12 14:53:45 +00:00
mccallum
0f270ba791 ([TcpInPort -receivePacketWithTimeout:]): Move initialization of
select_timeout to inside loop since Linux select() modifies
*select_timeout.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1095 72102866-910b-0410-8b05-ffd578937521
1996-03-07 20:51:50 +00:00
mccallum
4e48eb0082 Assert is_valid in many places.
([TcpInPort +newForReceivingFromPortNumber:]): Get the address of the
host, not localhost=127.0.0.1.
([TcpInPort -invalidate]): Remove ourselves from socket_2_port and
port_number_2_port here instead of in -dealloc.
([TcpInPort -description]): Indicate whether we are valid or not in
string.
([TcpOutPort -description]): Likewise.
([TcpOutPort -invalidate]): Assert is_valid, don't just conditionally
execute body.  Remove ourselves from out_port_bag and socket_2_port
here, not in -dealloc.
([TcpPacket +_getPacketSize:andReplyPort:fromSocket:inPort:]): If we
don't read() full prefix, don't abort(), just return EOF.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1091 72102866-910b-0410-8b05-ffd578937521
1996-03-07 18:14:23 +00:00
mccallum
ed0c23d9a9 Many ivar names changed for clarity. Some new ivars added; see
changes to TcpPort.h.  Overhaul of how TcpOutPort's track their remote
address.  Previously they used the address of their local peer; this
is no good when encoding a TcpOutPort on the wire for D.O.; the
D.O. reciever needs a way to contact the listen'ing socket of the
TcpInPort in order to form a new connection.  _remote_in_port_address
is now the address of the remote listen'ing socket.  Added many
comments throughout.  All perror() calls changes to be more
informative.
(debug_tcp_port): Make this a static variable instead of a macro.
(init_socket_2_port): Check pre-existance of socket_2_port here
instead of callers.
([TcpInPort +newForReceivingFromPortNumber:]): Method overhauled.
Don't bind socket to INADDR_ANY because we need to be able to encode
our unique host address on the wire for D.O.
([TcpInPort -_listeningSockaddr]): New method.
([TcpInPort -receivePacketWithTimeout:]): Method overhauled.  Get the
reply port for an incoming packet from the packet prefix.
([TcpInPort -_connectedOutPortInvalidated:]): Add debugging message.
([TcpInPort -classForConnectedCoder:]): Return the TcpOutPort class,
not [self class] because we always encode a "send right" (ala Mach),
not a "recieve right".
([TcpOutPort
+newForSendingToSockaddr:withAcceptedSocket:pollingInPort:]): Method
renamed, and majorly overhauled.  Now many different combinations of
NULL argument do different things.  This is now the single designated
initializer.  We now check both the SOCKADDR and the SOCK argument to
find previously-created TcpOutPort's.  This method is also used to set
the remote_in_port_address of an already-created TcpOutPort.  There is
more error checking.
([TcpOutPort +newForSendingToPortNumber:onHost:]): Overhauled.
([TcpOutPort +_newWithAcceptedSocket:peeraddr:inPort:]): Overhauled to
work with new designated  initalizer.
([TcpOutPort -sendPacket:withTimeout:]): Use new low-level Packet
interface that deals with reply ports.
([TcpOutPort +packetClass]): New method.
(PREFIX_LENGTH_TYPE): New macro.
(PREFIX_LENGTH_SIZE): New macro.
(PREFIX_ADDRESS_TYPE): New macro.
(PREFIX_ADDRESS_SIZE): New macro.
(PREFIX_SIZE): New macro.
([TcpPacket -_initForReceivingWithSize:replyPort:]): Use 0 prefix,
because the separate +_getPacketSize... method reads those bytes.
([TcpPacket -_writeToSocket:withReplySockaddr:]): Now the prefix
includes the sockaddr of the reply port.  If ADDR is non-null, set the
reply port address portion of the prefix.
([TcpPacket +_getPacketSize:andReplyPort:fromSocket:inPort:]): New
method, replacing +readPacketSizeFromSocket:.
([TcpPacket -_fillFromSocket:]): Set Stream's eofPosition properly.
Leave Stream's position at zero.
(InPortAcceptedClientNotification): New notification string.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1063 72102866-910b-0410-8b05-ffd578937521
1996-03-06 14:35:57 +00:00
mccallum
6cc416e14e ([TcpInPort -numberOfConnectedOutPorts]): New method.
([TcpInPort -_connectedOutPortInvalidated:]): Post an
InPortClientBecameInvalidNotification.
([TcpInPort -portNumber]): New method.
([TcpInPort -description]): New method.
([TcpOutPort +newWithAcceptedSocket:inPort:]): Fill in the _address
ivar.
([TcpOutPort -portNumber]): New method.
([TcpOutPort -description]): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1039 72102866-910b-0410-8b05-ffd578937521
1996-03-03 00:40:46 +00:00
mccallum
b28e7c8ede New file.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1022 72102866-910b-0410-8b05-ffd578937521
1996-03-01 16:06:57 +00:00