Sample code for 30+ languages & platforms
Classic ASP

Example: Socket.AcceptNext method

Demonstrates how to call the AcceptNext method.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

set listenSocket = Server.CreateObject("Chilkat.Socket")
set connectedSocket = Server.CreateObject("Chilkat.Socket")

port = 5555
backlog = 25
success = listenSocket.BindAndListen(port,backlog)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( listenSocket.LastErrorText) & "</pre>"
    Response.End
End If

' Accept next incoming connection
maxWaitMs = 200000
success = listenSocket.AcceptNext(maxWaitMs,connectedSocket)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( listenSocket.LastErrorText) & "</pre>"
    Response.End
End If

' ...
' ...

maxWaitMs = 20000
success = connectedSocket.Close()

%>
</body>
</html>