Changeset 2f19103 in mainline for uspace/srv/net/tcp/test.c
- Timestamp:
- 2015-05-22T07:21:37Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 58e9dec
- Parents:
- bf7587b0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/tcp/test.c
rbf7587b0 r2f19103 1 1 /* 2 * Copyright (c) 201 1Jiri Svoboda2 * Copyright (c) 2015 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 50 50 { 51 51 tcp_conn_t *conn; 52 tcp_sock_t lsock; 53 tcp_sock_t fsock; 52 inet_ep2_t epp; 54 53 char rcv_buf[RCV_BUF_SIZE + 1]; 55 54 size_t rcvd; … … 57 56 58 57 printf("test_srv()\n"); 59 60 inet_addr(&lsock.addr, 127, 0, 0, 1); 61 lsock.port = 80; 62 63 inet_addr(&fsock.addr, 127, 0, 0, 1); 64 fsock.port = 1024; 65 58 59 inet_ep2_init(&epp); 60 61 inet_addr(&epp.local.addr, 127, 0, 0, 1); 62 epp.local.port = 80; 63 64 inet_addr(&epp.remote.addr, 127, 0, 0, 1); 65 epp.remote.port = 1024; 66 66 67 printf("S: User open...\n"); 67 tcp_uc_open(& lsock, &fsock, ap_passive, 0, &conn);68 tcp_uc_open(&epp, ap_passive, 0, &conn); 68 69 conn->name = (char *) "S"; 69 70 … … 93 94 { 94 95 tcp_conn_t *conn; 95 tcp_sock_t lsock; 96 tcp_sock_t fsock; 96 inet_ep2_t epp; 97 97 const char *msg = "Hello World!"; 98 98 99 99 printf("test_cli()\n"); 100 101 inet_addr(&lsock.addr, 127, 0, 0, 1); 102 lsock.port = 1024; 103 104 inet_addr(&fsock.addr, 127, 0, 0, 1); 105 fsock.port = 80; 100 101 inet_ep2_init(&epp); 102 103 inet_addr(&epp.local.addr, 127, 0, 0, 1); 104 epp.local.port = 1024; 105 106 inet_addr(&epp.remote.addr, 127, 0, 0, 1); 107 epp.remote.port = 80; 106 108 107 109 async_usleep(1000*1000*3); 108 110 printf("C: User open...\n"); 109 tcp_uc_open(& lsock, &fsock, ap_active, 0, &conn);111 tcp_uc_open(&epp, ap_active, 0, &conn); 110 112 conn->name = (char *) "C"; 111 113
Note:
See TracChangeset
for help on using the changeset viewer.