| | |
Socket Programming Ports
![]() |
•
•
Join Date: Mar 2009
Posts: 123
Reputation:
Solved Threads: 0
Hello friends,
As usual .. when i have a problem ... daniweb.com is here
. So I need some information from you. Ok, let me explain ... I am currently developing a chat application ! Ok ... everything works fine till now but I have doubts.
My application uses 3 ports, one for the general chat room, one for personal chat and one for file transfer. I have used 3 random ports .. 4321, 4532 and 4533.
Is there a standard port to used?
What will happen if I run this application on a computer where these 3 ports is in used?
And finally, how to know if a port is in used or not ?
Thanks a lot for your answers guys.
Regards,
Mike.
As usual .. when i have a problem ... daniweb.com is here
. So I need some information from you. Ok, let me explain ... I am currently developing a chat application ! Ok ... everything works fine till now but I have doubts. My application uses 3 ports, one for the general chat room, one for personal chat and one for file transfer. I have used 3 random ports .. 4321, 4532 and 4533.
Is there a standard port to used?
What will happen if I run this application on a computer where these 3 ports is in used?
And finally, how to know if a port is in used or not ?
Thanks a lot for your answers guys.
Regards,
Mike.
http://www.iana.org/assignments/port-numbers
You definitely need to avoid anything with a published port number.
As for picking ports which are unused, it's a crap shoot.
I would suggest that you make the listening ports configurable.
If your s/w takes off and everyone wants to use it, then getting an assigned IANA port number would generally solve the problem.
You definitely need to avoid anything with a published port number.
As for picking ports which are unused, it's a crap shoot.
I would suggest that you make the listening ports configurable.
If your s/w takes off and everyone wants to use it, then getting an assigned IANA port number would generally solve the problem.
Hi,
- There are 65536 ports (TCP) i.e 0-65535
- Port No 0 to 1023 are reserved for well known services (http, ftp, telnet)
- If you try to use a port already in use, you will get a BindException
- You can run a port scanner program to check what your ports are doing
My blog on .NET- http://dotnet.tekyt.info
•
•
Join Date: Mar 2009
Posts: 123
Reputation:
Solved Threads: 0
Thanks for the answer guys! To Salem, you suggest me to allow the user to configure or set the port himself? OK, but will it make my program less user friendly ?
I understand you but how MSN works ?
To tuse, I got your point ... I must create a form to allow the user to choose another port if there is a BindException. Thanks...
But still I want to know MSN Messenger works !!! I made some research but can't find anything useful that can help me to make my program more efficient.
Thanks a lot for your answers.
Regards,
Mike
I understand you but how MSN works ?
To tuse, I got your point ... I must create a form to allow the user to choose another port if there is a BindException. Thanks...
But still I want to know MSN Messenger works !!! I made some research but can't find anything useful that can help me to make my program more efficient.
Thanks a lot for your answers.
Regards,
Mike
Last edited by neutralfox; May 23rd, 2009 at 10:21 am.
•
•
Join Date: Mar 2009
Posts: 123
Reputation:
Solved Threads: 0
Thanks tuse.
@ Salem, in the link you send me:
Mention that:
"CCP Registered ports SHOULD NOT be used without IANA registration.
The registration procedure is defined in [RFC4340], Section 19.9."
So I can't use port 0 - 49151.
What happened if i used one of these ports ? Will I have to pay a fine? And how much is the registration ?
Because its just a open source software which I am developing for learning and to share among friends.
Thanks a lot for your answers.
@ Salem, in the link you send me:
Mention that:
"CCP Registered ports SHOULD NOT be used without IANA registration.
The registration procedure is defined in [RFC4340], Section 19.9."
So I can't use port 0 - 49151.
What happened if i used one of these ports ? Will I have to pay a fine? And how much is the registration ?
Because its just a open source software which I am developing for learning and to share among friends.
Thanks a lot for your answers.
![]() |
Similar Threads
- Socket Programming... (C#)
- About socket programming in php (PHP)
- Socket Programming (C++)
- Eclipse SDK/Socket Programming help (Java)
- Socket Programming (ASP.NET)
- C++ socket programming (C++)
- Socket programming + porting Unix to Win32 (C)
Other Threads in the Java Forum
- Previous Thread: [Help]problem in networking j2me
- Next Thread: [ask] my text don't move to next line when saved. How to solve it?
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary blackberry block bluetooth character chat class client code component consumer csv database desktop developmenthelp eclipse error fractal ftp game givemetehcodez graphics gui html ide image integer j2me j2seprojects japplet java javaarraylist javac javaee javaprojects jni jpanel julia lego linked linux list loops mac map method methods mobile netbeans newbie number objects online oriented panel printf problem program programming project projects properties recursion replaydirector reporting researchinmotion rotatetext rsa scanner se server set singleton sms sort sql string swing test textfields threads time title tree tutorial-sample ubuntu update windows working






