![]() |
| | #1 |
| Never Exist Join Date: Jul 2004
Posts: 149
| now i wanna make sure that, once the server-socket accept a connection,this connection won't last more than 10 seconds. if one connection lasts more than 10 seconds,then the server-socket should close the connection automatically. is there anyway to set that time limit? any suggestion would be greatly appreciated.......
__________________ blow me ... ... |
| Hermitsky is offline | |
| | #2 |
| Unregistered User Join Date: Sep 2005 Location: Antarctica
Posts: 341
| you can set read and write timeouts, but if you want to limit the connection time to 10 seconds, you will need to do something like spawn a separate thread for each connection, have it sleep 10 seconds and then close the socket if it hasn't been closed yet. |
| rockytriton is offline | |
| | #3 |
| Never Exist Join Date: Jul 2004
Posts: 149
| Thanks, rockytriton. one more question: how to set the read time-out ?
__________________ blow me ... ... |
| Hermitsky is offline | |
| | #4 |
| Registered User Join Date: Sep 2004 Location: California
Posts: 3,020
| |
| bithub is offline | |
| | #5 |
| Never Exist Join Date: Jul 2004
Posts: 149
| thanks guys .....
__________________ blow me ... ... |
| Hermitsky is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cross Network communication using Winsock2? | dp_76 | Networking/Device Communication | 6 | 05-20-2005 07:05 AM |
| connecting to ftp server (winsock2) | commissar | C++ Programming | 1 | 03-03-2005 10:22 AM |
| Linker errors on Winsock2 functions | ShadowMetis | C++ Programming | 2 | 11-20-2004 11:19 PM |
| cant use winsock2 in dev-c++ | datainjector | Tech Board | 2 | 08-30-2003 03:55 PM |
| Strange MSVC winsock2 compile error | LuckY | Windows Programming | 3 | 06-28-2003 08:18 AM |