Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions netmem_cache/netmem_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <stdlib.h>
#include <poll.h>

static const char *host = "localhost";

enum
{
WRRQ = 1,
Expand Down Expand Up @@ -252,7 +254,7 @@ handlecon(int confd, void *arg, int port)
{
memfd = confd;
printf("connected to pdp-6 %d\n", memfd);
int fd = dial("maya", 10006);
int fd = dial(host, 10006);
if(fd < 0)
goto discon;
printf("connected fd %d\n", fd);
Expand All @@ -267,13 +269,16 @@ printf("connected fd %d\n", fd);
}

int
main()
main(int argc, char **argv)
{
static struct PortHandler port20006 = {
.port = 20006,
.handle = handlecon
} ;

if (argc > 1)
host = argv[1];

serveN(&port20006, 1, NULL);

return 0;
Expand Down
25 changes: 9 additions & 16 deletions pdp6/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,13 @@ netthread(void *arg)
return nil;
}

/*
char *argv0;
void
usage(void)
{
fprintf(stderr, "usage: %s [-h host] [-p port]\n", argv0);
fprintf(stderr, "usage: %s [-m host] [-p port]\n", argv0);
exit(1);
}
*/

static void
cleanup(void *arg)
Expand All @@ -383,23 +381,19 @@ main(int argc, char *argv[])
Panel *panel;
PDP6 pdp6, *pdp = &pdp6;

/*
const char *host;
int port;
const char *mhost = "localhost";
int mport = 20006;

host = "localhost";
port = 3400;
ARGBEGIN {
case 'h':
host = EARGF(usage());
case 'm':
mhost = EARGF(usage());
break;
case 'p':
port = atoi(EARGF(usage()));
mport = atoi(EARGF(usage()));
break;
default:
usage();
} ARGEND;
*/

panel = getpanel();
if(panel == nil) {
Expand Down Expand Up @@ -448,13 +442,12 @@ main(int argc, char *argv[])



// pdp->netmem_fd.fd = dial("maya", 10006);
/*
pdp->netmem_fd.fd = dial("maya", 20006);
pdp->netmem_fd.fd = dial(mhost, mport);
if(pdp->netmem_fd.fd >= 0)
printf("netmem connected\n");
else
printf("netmem not connected\n");
waitfd(&pdp->netmem_fd);
*/

void initlua(PDP6 *pdp);
initlua(pdp);
Expand Down