Review Request (M) - 7157695 - Add windows implementation of socket interface

Nils Eliasson nils.eliasson at oracle.com
Tue Apr 24 12:50:35 PDT 2012


1 or 2, I have lost the count. One is the Projectcreator improvement, 
and I need another review on that before it can be submitted.

Thanks a lot!

//N

Christian Thalinger skrev 2012-04-24 18:04:
> Ohh, right.  Since Tom left I will take care of your commits now.  How 
> many more do you need?
>
> -- Chris
>
> On Apr 24, 2012, at 5:20 AM, Nils Eliasson wrote:
>
>> Would you mind pushing this for me?
>>
>> //Nils
>>
>>>
>>> This seems to be the least intrusive change and since nobody ever 
>>> needed this before but you (and I guess you tested it) this looks good.
>>>
>>> -- Chris
>>>
>>>>
>>>> Thanks,
>>>> //Nils
>>>>
>>>>
>>>> Vladimir Kozlov skrev 2012-04-10 17:08:
>>>>> +  int ret = ::ioctlsocket(fd, FIONREAD, (u_long*)pbytes);
>>>>>
>>>>> What type is u_long? VM has defined type 'ulong' not 'u_long'.
>>>>>
>>>>> Otherwise looks good.
>>>>>
>>>>> Vladimir
>>>>>
>>>>> On 4/10/12 6:45 AM, Nils Eliasson wrote:
>>>>>> Any comments on the latest rev?
>>>>>>
>>>>>> //Nils
>>>>>>
>>>>>> Nils Eliasson skrev 2012-03-30 10:40:
>>>>>>> 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/20120424/49e31a07/attachment.html 


More information about the hotspot-dev mailing list