Porting java to c# questions ?

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.
 
R

Red Forks

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top