updated prog4
git-svn-id: svn://anubis/gvsu@275 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
5bf694622e
commit
38452f6f26
@ -326,6 +326,7 @@ public class ChatClient
|
||||
{
|
||||
String user = "user";
|
||||
String host = "localhost";
|
||||
int port = 42842;
|
||||
|
||||
for (int arg = 0; arg < args.length; arg++)
|
||||
{
|
||||
@ -342,7 +343,7 @@ public class ChatClient
|
||||
}
|
||||
}
|
||||
|
||||
PresenceService pServ = new PresenceServiceImpl();
|
||||
PresenceService pServ = new PresenceServiceImpl(host, port);
|
||||
|
||||
ChatClient chatClient = new ChatClient(pServ, user);
|
||||
chatClient.run();
|
||||
|
@ -49,7 +49,7 @@ public class ChatServer extends Application
|
||||
{
|
||||
// Create a component with an HTTP server connector
|
||||
Component comp = new Component();
|
||||
comp.getServers().add(Protocol.HTTP, 3000);
|
||||
comp.getServers().add(Protocol.HTTP, 42842);
|
||||
|
||||
// Attach the application to the default host and start it
|
||||
comp.getDefaultHost().attach("/v1", new ChatServer());
|
||||
|
@ -13,8 +13,13 @@ import edu.gvsu.cis.cs656.lab4.server.RegistrationInfo;
|
||||
|
||||
public class PresenceServiceImpl implements PresenceService
|
||||
{
|
||||
public PresenceServiceImpl()
|
||||
private int myPort;
|
||||
private String myHost;
|
||||
|
||||
public PresenceServiceImpl(String host, int port)
|
||||
{
|
||||
myHost = host;
|
||||
myPort = port;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user