| 781 | } |
| 782 | |
| 783 | void configureSocketTCP(xsMachine *the, xsSocket xss) |
| 784 | { |
| 785 | xsmcGet(xsVar(0), xsArg(0), xsID_keepalive); |
| 786 | if (xsmcTest(xsVar(0))) { |
| 787 | xsmcGet(xsVar(1), xsVar(0), xsID_enable); |
| 788 | if (xsmcTest(xsVar(1))) { |
| 789 | xss->skt->so_options |= SOF_KEEPALIVE; |
| 790 | |
| 791 | if (xsmcHas(xsVar(0), xsID_idle)) { |
| 792 | xsmcGet(xsVar(1), xsVar(0), xsID_idle); |
| 793 | xss->skt->keep_idle = xsmcToInteger(xsVar(1)); |
| 794 | } |
| 795 | if (xsmcHas(xsVar(0), xsID_interval)) { |
| 796 | xsmcGet(xsVar(1), xsVar(0), xsID_interval); |
| 797 | xss->skt->keep_intvl = xsmcToInteger(xsVar(1)); |
| 798 | } |
| 799 | if (xsmcHas(xsVar(0), xsID_count)) { |
| 800 | xsmcGet(xsVar(1), xsVar(0), xsID_count); |
| 801 | xss->skt->keep_cnt = xsmcToInteger(xsVar(1)); |
| 802 | } |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | xsmcGet(xsVar(0), xsArg(0), xsID_noDelay); |
| 807 | if (xsmcTest(xsVar(0))) |
| 808 | tcp_nagle_disable(xss->skt); |
| 809 | } |
| 810 | |
| 811 | void socketMsgConnect(xsSocket xss) |
| 812 | { |