Forum Discussion
stapleshome7
11 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
- 4 years ago
- 5 years ago
Recent Discussions
- 3 days ago
- 3 days ago
- 7 days ago