Review Request (M) - 7157695 - Add windows implementation of socket interface
Nils Eliasson
nils.eliasson at oracle.com
Fri Mar 30 01:40:35 PDT 2012
ok,
New webrev here: http://cr.openjdk.java.net/~neliasso/7157695/webrev.03/
<http://cr.openjdk.java.net/%7Eneliasso/7157695/webrev.03/>
Defining socklen_t as int on windows makes a much better impl.
Remains some casts from size_t to int on windows. So we have jni call in
jvm.h with jint/int -> os.hpp with size_t -> os_windows.hpp with int.
But we don't expect any negative lenghts so it should work.
Thanks for the feedback,
Nils E
David Holmes skrev 2012-03-29 23:20:
> On 30/03/2012 4:36 AM, Dean Long wrote:
>> Isn't this webrev reversing the recent changes for 7091417?
>
> Yes - and it shouldn't be. size_t's and socklen_t's are the correct
> types to use.
>
> David
>
>> dl
>>
>> On 3/29/2012 10:42 AM, Christian Thalinger wrote:
>>> I'm pretty sure this gets us into trouble with some compiler somewhere
>>> (I'd guess GCC on Linux). On Mac OS X send is declared as:
>>>
>>> ssize_t
>>> send(int socket, const void *buffer, size_t length, int flags);
>>>
>>> but length is now passed as int:
>>>
>>> -inline int os::send(int fd, char* buf, size_t nBytes, uint flags) {
>>> +inline int os::send(int fd, char* buf, int nBytes, int flags) {
>>> RESTARTABLE_RETURN_INT(::send(fd, buf, nBytes, flags));
>>> }
>>>
>>> I think your changes are good but we might need some casts down in the
>>> OS files eventually.
>>>
>>> -- Chris
>>>
>>> On Mar 29, 2012, at 3:00 PM, Nils Eliasson wrote:
>>>
>>>> http://cr.openjdk.java.net/~neliasso/7157695/webrev.01/<http://cr.openjdk.java.net/%7Eneliasso/7157695/webrev.01/>
>>>>
>>>>
>>>>
>>>> 7157695 - Add windows implementation of socket interface
>>>>
>>>> Using winsock api which is almost posix compatible. Also changing
>>>> some argument types for the socket interface calls in os.hpp to make
>>>> the platform independent code more platform independent. This made
>>>> the win implementation possible without casts, and allowed me to
>>>> remove a lot of redundant casts from the jni exports in jvm.cpp.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-dev/attachments/20120330/b2af212f/attachment.html
More information about the hotspot-dev
mailing list