Forum Discussion
stapleshome7
10 years agoNew Contributor
Hi Staff,
I am having some trouble with the TCP/IP server code published on your website. It fails on socket.bind. the error says :
Invalid procedure call or argument
address = "127.0.0.1";
port = 3751;
receiveTimeout = 15000;
connectionsQueueLength = 2;
socket = dotNET.System_Net_Sockets.Socket.zctor(
dotNET.System_Net_Sockets.AddressFamily.InterNetwork,
dotNET.System_Net_Sockets.SocketType.Stream,
dotNET.System_Net_Sockets.ProtocolType.Tcp
);
broadcast = dotNET.System_Net.IPAddress.Parse(address);
endpoint = dotNET.System_Net.IPEndPoint.zctor_2(broadcast, port);
socket.Bind(endpoint);
socket.Listen(connectionsQueueLength);
connectedSocket = socket.Accept();
connectedSocket.SetSocketOption_3(
dotNET.System_Net_Sockets.SocketOptionLevel.Socket,
dotNET.System_Net_Sockets.SocketOptionName.ReceiveTimeout,
receiveTimeout);
..................
Is there anything that I'm doing wrong?
I am having some trouble with the TCP/IP server code published on your website. It fails on socket.bind. the error says :
Invalid procedure call or argument
address = "127.0.0.1";
port = 3751;
receiveTimeout = 15000;
connectionsQueueLength = 2;
socket = dotNET.System_Net_Sockets.Socket.zctor(
dotNET.System_Net_Sockets.AddressFamily.InterNetwork,
dotNET.System_Net_Sockets.SocketType.Stream,
dotNET.System_Net_Sockets.ProtocolType.Tcp
);
broadcast = dotNET.System_Net.IPAddress.Parse(address);
endpoint = dotNET.System_Net.IPEndPoint.zctor_2(broadcast, port);
socket.Bind(endpoint);
socket.Listen(connectionsQueueLength);
connectedSocket = socket.Accept();
connectedSocket.SetSocketOption_3(
dotNET.System_Net_Sockets.SocketOptionLevel.Socket,
dotNET.System_Net_Sockets.SocketOptionName.ReceiveTimeout,
receiveTimeout);
..................
Is there anything that I'm doing wrong?
Related Content
- 3 years ago
- 3 years ago
- 3 years ago
Recent Discussions
- 15 hours ago