Porting java to c# questions ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

1. How can i know that a socket finished the CONNECT operation or failed
when i use the Socket.Select method to monitor a list of sockets ?

2. Is there is any more detailed document on how to migrate a java code
that used the java.nio package to c# single thread that use Socket.Select
method, because the migrating document in the msdn web site is not very
detailed ?

3. How to port this java code :
a. java.nio.ByteBuffer.duplicate();
b. java.nio.ByteBuffer.flip();

Thanks.
 
yaron said:
Hi,

1. How can i know that a socket finished the CONNECT operation or failed
when i use the Socket.Select method to monitor a list of sockets ?

2. Is there is any more detailed document on how to migrate a java code
that used the java.nio package to c# single thread that use Socket.Select
method, because the migrating document in the msdn web site is not very
detailed ?

3. How to port this java code :
a. java.nio.ByteBuffer.duplicate();
b. java.nio.ByteBuffer.flip();

Thanks.
1. if connect fail, the socket will in exception list, if connect ok, the
socket will in the wriable list.
2. I don't think select is useful in dotnet. It has a limit of Max 64 socket
can be selected. also, select is not usefull in winsock. I suggest you use
overlapped i/o feature of socket.
3. I don't know much of Java, but I think Buffer class may usefull for you.
 
Back
Top