[Common-dev] CR: part 3: sockimp connect failure fix plus related host byte-order fix, etc.
Liam Murray liamm at real.comI'm still in the process of verifying my commit. I've already found these - they should be fixed. I'm still getting a lot of errors about AllowancePlugins using undefined class PluginHandler so I may be missing more. (The only other anticipated break might have to do with the renaming of some socket options.) Liam At 04:43 PM 8/9/2004, Jamie Gordon wrote: >This checkin breaks several server modules, is someone >fixing this? > > >..\..\..\server\engine\netio\pub\servsockimp.h(174) : error C2555: >'CServerNetServicesContext::Init': overriding virtual function return type >differs and is not covariant from 'CHXNetServices::Init' >..\..\..\common\netio\pub\platform\posix\sockimp.h(446) : see declaration >of 'CHXNetServices::Init' > > >Jamie > > > >Liam Murray wrote: > >>[Sorry, this has evolved into a big CR with a lot of small changes.] >>Summary: >>---------------- >>Misc. accumulated fixes to common/netio and client/common/netio. Mostly >>socket option updates, a byte order fix and connect failure fix. >>Details: >>----------- >> >>In addition to changes in previous CRs, this adds the following >>modifications: >>1) Eric Hyche suggested in response to my last CR that SetAddr() take >>only host order arguments. I agree that we should only use host order >>whenever possible. Now only one method in hxsockutil accepts net-order >>arguments and has been renamed to SetAddrNetOrder. This is used in cases >>where we get an inet_addr or some other bsd struct and are creating an >>IHXSockAddr. If only we used strings for address and port representation >>we could avoid all these net/host order problems. :) >>2) Updates (mostly to shim socket code) to only store and pass arguments >>in host order; removed net order/host order conversions. Removed unused >>(and duplicated i HXSockUtil) function >>CHXClientNetServicesShim::CreateSocketAddress(). >>3) Small fix in HXSockUtil::SetAddr() which would likely crash in very >>unlikely case that FromCharArray fails. >>4) Added HX_SOCKOPT_READBUF_FLAG socket option. Value can be one of >>following. >>HX_SOCK_READBUF_SIZE_DEFAULT >>HX_SOCK_READBUF_SIZE_COPY // copy to precisely sized buffer after read >>HX_SOCK_READBUF_SIZE_PEEK // use FIONBIO or equivalent (not implemented) >>Note that if HX_SOCK_READBUF_SIZE_PEEK were to work reliably across >>platforms HX_SOCK_READBUF_SIZE_COPY may not be needed. However, I'm not >>at this point sure it is reliably supported and efficient. >>6) Added HX_SOCKOPT_READBUF_MAX socket option. Value is a number that >>specifies override value for m_mss (otherwise defaults to approx. 64K for >>UDP and max segment size or 1500 for TCP) >>7) Set DEFAULT_UDP_READ_SIZE to 0xf000 if symbian defined in hxnet.h. >>8) Added some code to GetOption to return currently set values for >>missing HXSockOpt that were recently added. >>9) Split hxclientsockimp.cpp in client/common/netio/platform/posix into >>two files chxclientsocket.cpp and chxclientnetservices.cpp for sake of >>cleaner organization. >>As a reminder, this also includes the following items from previous CRs: >>1) Net order fix in hxsockutil >>2) Moved IHXScheduler assert so it only asserts when socket idle timeout >>option is used (otherwise asserts when using simple context objects such >>as mini context) >>3) Fix in sockimp to better handle connect failure. When a connect fails >>a write event is passed to OnEvent(). If an error is associated with the >>event the connect event is forwarded to IHXSocketResponse with the error >>code and no write event is subsequently sent. The first write event is >>only sent if the connection is successful. (This is how WSA event >>semantics works. Please verify this makes sense for us to follow.) Also >>note that a close event should not be sent unless a connection was >>successfully established for a socket. (Again, this corresponds with WSA >>semantics.) >>4) When the windows client gets an FD_CONNECT along with a failure code >>from WSAAsyncSelect, it is passed on as a write event to >>CHXSocket::OnEvent(). Otherwise the connect is passed on upon receiving >>the first write event. >>5) Changed CHXSocket::Init() so it returns an HX_RESULT. This is >>particularly helpful for the client derivations because they >>initialize/allocate resources during initialization. >>Branch: HEAD >>Builds, platforms verified: Windows client >>Liam >