|
-
April 22nd, 2003, 12:40 PM
#1
Socket
is someone know here how it possible to know if a port is in use or not
imagine you have your serveur who want toopen multiple listener socket
exple
while(kljfdlkljkdf)
if this port is ok listenat this port
else
port++
if you think that you c'ant that's means that you can !! : think about it all your life if you understand there you can
-
April 22nd, 2003, 12:47 PM
#2
You could try to open each port, on ports already in use the listen function should return an error code.
Other way would be to manually attempt connections to 127.0.0.1 (localhost) at port X, if you are able to connect to it then it is listening, close the connection and proceed to the next port.
int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\
o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}
-
April 22nd, 2003, 02:03 PM
#3
I believe the IP Helper API has functions that can help you here. In particular, GetTcpTable can enumerate open TCP ports on the various addresses mapped by the machine, and there is a similar UDP function. Additionally, full source code is available here for a program that shows how to use the IP Helper API to get all sorts of useful information. I hope this is helpful!
*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/
"It's hard to believe in something you don't understand." -- the sidhi X-files episode
galathaea: prankster, fablist, magician, liar
-
April 22nd, 2003, 05:08 PM
#4
thx for the tow solutions
but i think i prefer try a listning in this case.
there is a socket error
it's not too long to execute
if you think that you c'ant that's means that you can !! : think about it all your life if you understand there you can
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|