Link to home
Start Free TrialLog in
Avatar of AnthonyCosenza
AnthonyCosenza

asked on

UDP Instant Messaging Server

As part of the server i need a statement that will return the host name that is given by the client as well as the port of the client the other client asks for.

Here is the snipit of wat i hav so far..

            // Part of if statement to handle "where" command
            } else if (received.startsWith("where")) {
                String host = st.nextToken();
               

                retMes = "@"+host+":"+userport;

wat needs to go in the middle??
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AnthonyCosenza
AnthonyCosenza

ASKER

the thing is the port isnt a token

there is no next token....

all i hav is the client name to get the port number of that client with
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the way this part works:

1. a client sends a who <username> to server (username bein another client)
2. server looks through to get the host name
3. returns @host:port back to the first client (where host and port are details of the second client)

hope that clears it up
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

how would this be done??
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial