Computing.Net > Forums > Programming > Java problem: UDP client and server

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Java problem: UDP client and server

Reply to Message Icon

Name: UnixNewbie
Date: July 13, 2004 at 16:58:34 Pacific
OS: Windows XP
CPU/Ram: Pentium 4
Comment:

Hi, I was wondering if anybody could help me with this question?
I have a UDP client and UDP Server program written in java and I was wondering:

I have to following line of code DatagramSocket clientSocket = new DatagramSocket();

if I change it to

DatagramSocket clientSocket = new DatagramSocket(5432);

in the UDPClient file will it be necessary to change the UDPServer file? This will effect the port numbers for the sockets in both files, right? Can anybody tell me how and what they were before?

I am very new to java, as a matter of fact this is my first try and I would appreaciate any help I can get.

Thank you!


UnixNewbie




Sponsored Link
Ads by Google

Response Number 1
Name: gpp
Date: July 15, 2004 at 06:10:52 Pacific
Reply:

yup, the client will have to be changed too. you'll need to set it to broadcast to that port, or the server will never recieve anything.

if the port where set, you probably would have seen a number in there before.. whoever wrote this, probably left it up to the user to set the port and/or address.


0
Reply to Message Icon

Related Posts

See More


Get folder size PHP Email Function



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Java problem: UDP client and server

UDP Client/Server code in JAVA www.computing.net/answers/programming/udp-clientserver-code-in-java/6201.html

java: problem with loop and random www.computing.net/answers/programming/java-problem-with-loop-and-random/7789.html

How do I design VB client/servers www.computing.net/answers/programming/how-do-i-design-vb-clientservers/7764.html