Changes in uspace/srv/net/tcp/test.c [a2e3ee6:69a93df7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/test.c
ra2e3ee6 r69a93df7 38 38 #include <errno.h> 39 39 #include <stdio.h> 40 #include < fibril.h>40 #include <thread.h> 41 41 #include <str.h> 42 42 #include "tcp_type.h" … … 47 47 #define RCV_BUF_SIZE 64 48 48 49 static inttest_srv(void *arg)49 static void test_srv(void *arg) 50 50 { 51 51 tcp_conn_t *conn; … … 57 57 58 58 printf("test_srv()\n"); 59 60 inet_addr(&lsock.addr, 127, 0, 0, 1);61 59 lsock.port = 80; 62 63 inet_addr(&fsock.addr, 127, 0, 0, 1); 60 lsock.addr.ipv4 = 0x7f000001; 64 61 fsock.port = 1024; 65 62 fsock.addr.ipv4 = 0x7f000001; 66 63 printf("S: User open...\n"); 67 64 tcp_uc_open(&lsock, &fsock, ap_passive, 0, &conn); … … 87 84 88 85 printf("test_srv() terminating\n"); 89 return 0;90 86 } 91 87 92 static inttest_cli(void *arg)88 static void test_cli(void *arg) 93 89 { 94 90 tcp_conn_t *conn; … … 98 94 99 95 printf("test_cli()\n"); 100 101 inet_addr(&lsock.addr, 127, 0, 0, 1); 96 102 97 lsock.port = 1024; 103 104 inet_addr(&fsock.addr, 127, 0, 0, 1); 98 lsock.addr.ipv4 = 0x7f000001; 105 99 fsock.port = 80; 100 fsock.addr.ipv4 = 0x7f000001; 106 101 107 102 async_usleep(1000*1000*3); … … 117 112 printf("C: User close...\n"); 118 113 tcp_uc_close(conn); 119 120 return 0;121 114 } 122 115 123 116 void tcp_test(void) 124 117 { 125 fid_t srv_fid; 126 fid_t cli_fid; 118 thread_id_t srv_tid; 119 thread_id_t cli_tid; 120 int rc; 127 121 128 122 printf("tcp_test()\n"); … … 131 125 132 126 if (0) { 133 srv_fid = fibril_create(test_srv, NULL);134 if ( srv_fid == 0) {135 printf("Failed to create server fibril.\n");127 rc = thread_create(test_srv, NULL, "test_srv", &srv_tid); 128 if (rc != EOK) { 129 printf("Failed to create server thread.\n"); 136 130 return; 137 131 } 138 139 fibril_add_ready(srv_fid);140 132 } 141 133 142 134 if (0) { 143 cli_fid = fibril_create(test_cli, NULL);144 if ( cli_fid == 0) {145 printf("Failed to create client fibril.\n");135 rc = thread_create(test_cli, NULL, "test_cli", &cli_tid); 136 if (rc != EOK) { 137 printf("Failed to create client thread.\n"); 146 138 return; 147 139 } 148 149 fibril_add_ready(cli_fid);150 140 } 151 141 }
Note:
See TracChangeset
for help on using the changeset viewer.