Diff
Not logged in

Differences From Artifact [193fc7ab24]:

To Artifact [1274ecf59f]:


364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
364
365
366
367
368
369
370

371
372
373
374
375
376
377







-







 *
 * Side effects:
 *	Sets the device into blocking or nonblocking mode.
 *
 * ----------------------------------------------------------------------
 */

	/* ARGSUSED */
static int
TcpBlockModeProc(
    ClientData instanceData,	/* Socket state. */
    int mode)			/* The mode to set. Can be one of
				 * TCL_MODE_BLOCKING or
				 * TCL_MODE_NONBLOCKING. */
{
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
495
496
497
498
499
500
501

502
503
504
505
506
507
508







-







 *
 * Side effects:
 *	Reads input from the input device of the channel.
 *
 *----------------------------------------------------------------------
 */

	/* ARGSUSED */
static int
TcpInputProc(
    ClientData instanceData,	/* Socket state. */
    char *buf,			/* Where to store data read. */
    int bufSize,		/* How much space is available in the
				 * buffer? */
    int *errorCodePtr)		/* Where to store error code. */
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
587
588
589
590
591
592
593

594
595
596
597
598
599
600







-







 *
 * Side effects:
 *	Closes the socket of the channel.
 *
 *----------------------------------------------------------------------
 */

	/* ARGSUSED */
static int
TcpCloseProc(
    ClientData instanceData,	/* The socket to close. */
    Tcl_Interp *dummy)		/* For error reporting - unused. */
{
    TcpState *statePtr = (TcpState *)instanceData;
    int errorCode = 0;
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1114
1115
1116
1117
1118
1119
1120

1121
1122
1123
1124
1125
1126
1127







-







 *
 * Side effects:
 *	None.
 *
 * ----------------------------------------------------------------------
 */

	/* ARGSUSED */
static int
TcpGetHandleProc(
    ClientData instanceData,	/* The socket state. */
    int direction,		/* Not used. */
    ClientData *handlePtr)	/* Where to store the handle. */
{
    TcpState *statePtr = (TcpState *)instanceData;
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1711
1712
1713
1714
1715
1716
1717

1718
1719
1720
1721
1722
1723
1724







-







 * Side effects:
 *	Creates a new connection socket. Calls the registered callback for the
 *	connection acceptance mechanism.
 *
 *----------------------------------------------------------------------
 */

	/* ARGSUSED */
static void
TcpAccept(
    ClientData data,		/* Callback token. */
    int mask)			/* Not used. */
{
    TcpFdList *fds = (TcpFdList *)data;	/* Client data of server socket. */
    int newsock;		/* The new client socket */