I have an unmanaged library that handle many TCP/IP connections.
In my .NET application i want to test if there is input available
on these connections.
Using an existing function of the unmanaged library I'm able to retrieve
the list of Int32 socket-descriptors handled by the unmanaged library.
How can I use this list of Int32 socket-descriptors inside my C# program
to test if there is input available on these socket-descriptors?
I want to use the Socket.Select method of .NET
but this method wants a list of Socket
and I have only a list of Int32.
There is some manner to transform an Int32 socket-descriptor
into a Socket so I will be able to use Socket.Select?
Thanks for the help
-- Dario 7 2436
Dario wrote: I have an unmanaged library that handle many TCP/IP connections. In my .NET application i want to test if there is input available on these connections. Using an existing function of the unmanaged library I'm able to retrieve the list of Int32 socket-descriptors handled by the unmanaged library. How can I use this list of Int32 socket-descriptors inside my C# program to test if there is input available on these socket-descriptors?
I want to use the Socket.Select method of .NET but this method wants a list of Socket and I have only a list of Int32.
There is some manner to transform an Int32 socket-descriptor into a Socket so I will be able to use Socket.Select?
Thanks for the help
-- Dario
Any suggestion?
Dario wrote: I have an unmanaged library that handle many TCP/IP connections. In my .NET application i want to test if there is input available on these connections. Using an existing function of the unmanaged library I'm able to retrieve the list of Int32 socket-descriptors handled by the unmanaged library. How can I use this list of Int32 socket-descriptors inside my C# program to test if there is input available on these socket-descriptors?
I want to use the Socket.Select method of .NET but this method wants a list of Socket and I have only a list of Int32.
There is some manner to transform an Int32 socket-descriptor into a Socket so I will be able to use Socket.Select?
Thanks for the help
-- Dario
Any suggestion?
"Dario" <da***@despammed.com> wrote in message
news:bm**********@fata.cs.interbusiness.it... I have an unmanaged library that handle many TCP/IP connections. In my .NET application i want to test if there is input available on these connections. Using an existing function of the unmanaged library I'm able to retrieve the list of Int32 socket-descriptors handled by the unmanaged library. How can I use this list of Int32 socket-descriptors inside my C# program to test if there is input available on these socket-descriptors?
I want to use the Socket.Select method of .NET but this method wants a list of Socket and I have only a list of Int32.
There is some manner to transform an Int32 socket-descriptor into a Socket so I will be able to use Socket.Select?
I'm afraid there is no way I am aware of...it is likely not possible.
However, you could probably write a small piece of Managed C++ that performs
the select operation for you while exposing a nicer interface than PInvoke.
That unfortunatly is the only path I see(and that is basically all
Socket.Select does, wraps arround the native select call).
However, if anyone from MS is reading this, exposing support directly for
socket descriptors is of some use in interop situations!
Thanks for the help
-- Dario
"Dario" <da***@despammed.com> wrote in message
news:bm**********@fata.cs.interbusiness.it... I have an unmanaged library that handle many TCP/IP connections. In my .NET application i want to test if there is input available on these connections. Using an existing function of the unmanaged library I'm able to retrieve the list of Int32 socket-descriptors handled by the unmanaged library. How can I use this list of Int32 socket-descriptors inside my C# program to test if there is input available on these socket-descriptors?
I want to use the Socket.Select method of .NET but this method wants a list of Socket and I have only a list of Int32.
There is some manner to transform an Int32 socket-descriptor into a Socket so I will be able to use Socket.Select?
I'm afraid there is no way I am aware of...it is likely not possible.
However, you could probably write a small piece of Managed C++ that performs
the select operation for you while exposing a nicer interface than PInvoke.
That unfortunatly is the only path I see(and that is basically all
Socket.Select does, wraps arround the native select call).
However, if anyone from MS is reading this, exposing support directly for
socket descriptors is of some use in interop situations!
Thanks for the help
-- Dario
"Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in
news:Ufsib.553677$cF.233183@rwcrnsc53: However, if anyone from MS is reading this, exposing support directly for socket descriptors is of some use in interop situations!
Yes, but if you're doing interop, then you can do the interop to check the
socket descriptors directly.
We definately don't need the framework classes cluttered up with interop
calls for every imaginable situation (not to mention that that makes the
classes unportable!)
Mark
"Mark" <mark@--somewhere--.com> wrote in message
news:Xn******************************@207.46.248.1 6... "Daniel O'Connell" <onyxkirx@--NOSPAM--comcast.net> wrote in news:Ufsib.553677$cF.233183@rwcrnsc53:
However, if anyone from MS is reading this, exposing support directly for socket descriptors is of some use in interop situations!
Yes, but if you're doing interop, then you can do the interop to check the socket descriptors directly.
We definately don't need the framework classes cluttered up with interop calls for every imaginable situation (not to mention that that makes the classes unportable!)
Not nessecerly, Every socket runtime I know of uses a descriptor for
sockets, thats pretty standard. What the descriptor contains is irrelevent.
Beyond that, the feature certainly doesn't have to exist IN the socket
class, I just hate re-writing functionality that the framework already does,
quite literally, because they didn't expose the proper method.
If you look at the Socket.Select method, it converts the list of Sockets
into descriptors and passes them to the native select(the berkely one it
seems, not WSASelect). Now because there is no way to access that directly,
You are going to end up writing pretty close to identical code just because
they take sockets and convert them. Its a minor annoyance. However it
doesn't break portability any more than SetSocketOpt does.
It is far less annoying than the screwed up file naming rules for creating
file streams, but annoying none the less. Mark
Check out Socket.Select static method. It is in .NET 1.0, 1.1 and 2.0. It should do the job
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: DreJoh |
last post by:
I've read many articles on the subject and the majority of them give the same
solution that's in article 821625 on the MSDN website. I'm using the
following code and when a the client disconnects...
|
by: Grant Richard |
last post by:
Using the TcpListener and TcpClient I created a program that just sends and
receives a short string - over and over again. The program is fine until it
gets to around 1500 to 1800 messages. At...
|
by: zbcong |
last post by:
Hello:
I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting for a...
|
by: zhebincong |
last post by:
Hello:
I write a multithread c# socket server,it is a winform application,there is
a richtextbox control and button,when the button is click,the server begin
to listen the socket port,waiting...
|
by: Vladimir Lushnikov |
last post by:
Hi,
I'm experimenting with the Seqpacket protocol, because the
connectionless protocols aren't enough for my needs, and TCP/IP doesn't
preserve message boundaries.
This is what I've currently...
|
by: Macca |
last post by:
Hi,
I am writing an asychronous socket server to handle 20+ simulataneous
connections.
I have used the example in MSDN as a base. The code is shown at end of
question.
Each connection has a...
|
by: hazz |
last post by:
smtpClient.Send(message)
is causing me problems as per specifics in the trace below. Email is sent
but not without this error typically upon sending the second email, but
sometimes when running...
|
by: Kevin |
last post by:
I got the following error when revieving data from a server.
hostSystem.Net.Sockets.SocketException: An existing connection was forcibly
closed by the remote host at...
|
by: Mr. Beck |
last post by:
Hello,
Please Help.....
I have been working with some tcp/ip socket communication within a C#
program recently. Basicly, I have a program (myProblemProgram) that has a
socket connected to...
|
by: Arno |
last post by:
reposted with the right microsoft managed newsgroup ID: Sorry for the
inconvinience
Hi,
I've written a class for client-socket connection, but I get a lot of times
the error message "Unable...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |