add readme small list changes
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
Chatty is a simple, multithreaded chat program by Dane MacFadden.
|
||||||
|
It's inspired by an assignment I did in university that was a similar project
|
||||||
|
and is intended to be an exercise in networked and multithreaded programming.
|
||||||
|
Check out Beej's guide to network programming (and his other guides) if you want
|
||||||
|
to build something similar. Much of my code is based on his client and server.
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
#define MAXBUFSIZE 30
|
#define MAXBUFSIZE 30
|
||||||
#define BACKLOG 10
|
#define BACKLOG 10
|
||||||
|
|
||||||
|
LIST *receivelist, *sendlist;
|
||||||
|
|
||||||
void *input(void *arg) {
|
void *input(void *arg) {
|
||||||
while (1) {
|
while (1) {
|
||||||
/*
|
/*
|
||||||
@@ -59,7 +61,6 @@ int main(int argc, char* argv[]) {
|
|||||||
char *remote_machine, *local_port, *remote_port;
|
char *remote_machine, *local_port, *remote_port;
|
||||||
int status, socketfd, confd, len;
|
int status, socketfd, confd, len;
|
||||||
int yes = 1;
|
int yes = 1;
|
||||||
char buf[10];
|
|
||||||
|
|
||||||
if (argc != 4) {
|
if (argc != 4) {
|
||||||
printf("Wrong number of arguments. Usage: ./chatty <local port> \
|
printf("Wrong number of arguments. Usage: ./chatty <local port> \
|
||||||
@@ -71,6 +72,9 @@ int main(int argc, char* argv[]) {
|
|||||||
remote_machine = argv[2];
|
remote_machine = argv[2];
|
||||||
remote_port = argv[3];
|
remote_port = argv[3];
|
||||||
|
|
||||||
|
receivelist = ListCreate();
|
||||||
|
sendlist = ListCreate();
|
||||||
|
|
||||||
if (atoi(local_port) < atoi(remote_port)) {
|
if (atoi(local_port) < atoi(remote_port)) {
|
||||||
/* Congrats, you're the server */
|
/* Congrats, you're the server */
|
||||||
memset(&hints, 0, sizeof(hints));
|
memset(&hints, 0, sizeof(hints));
|
||||||
|
|||||||
Reference in New Issue
Block a user