mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
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
This commit is contained in:
parent
e2b839730f
commit
871b80f439
1 changed files with 749 additions and 271 deletions
1018
Source/TcpPort.m
1018
Source/TcpPort.m
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue