Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how do i know port number  RSS feed

 
shen zhang
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Socket client= new Socket (serverName, port);

if i want to know the number of port, how do i know, where can i check?

http://www.tutorialspoint.com/java/java_networking.htm



Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at server.main(server.java:41)


anyone can help me to understand the meaning of green line?

thank you
error.png
[Thumbnail for error.png]
error program
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Please post text and not an image as the image is not searchable. You can copy past your code. Also do remember to UseCodeTags

ArrayIndexOutOfBoundsException indicates you tried to access an array element whose index was greater than the actual number of elements in the array.
Since there are no line numbers in your image (the code tags will automatically insert these when you copy paste your code), I cannot figure out which line is #8 in client.java This line is causing the exception.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!