Hi Guys,
this is driving me nuts.
gSock = FreeFile
ERRCLEAR
Host Addr "192.168.0.233" To ipAddress&
Tcp Open Server Addr ipAddress& Port %DEFAULT_PORT As gSock
If Err Then
MsgBox "Access Denied, Cannot Open Port " + Str$(Err) , %MB_OK Or %MB_DEFBUTTON1 Or %MB_ICONWARNING Or %MB_SYSTEMMODAL, "Host Printer Server"
FF_CloseForm hwnd_ps
Exit Function
End If
I keep getting error 57. and its running on xp .
can anyone help
Paul.
QuoteError 57 - Device I/O error
Device I/O error - (%ERR_DEVICEIOERROR) - A hardware problem occurred when trying to carry out some device-orientated command.
For example, a COMM connection was lost during a session, or a TCP/UDP statement failed to be connected, etc. Alternatively, a TCP/UDP port may have been closed unexpectedly or the network refused the connection requested.
If an ERROR 57 occurs with a TCP OPEN statement under Windows 98 when using a dotted IP address string (i.e., "202.123.456.1"), then check to ensure that "Client for Microsoft Networks" is installed in the Network applet in Control Panel. Alternatively, manually add a DNS entry in the HOSTS file in the \WINDOWS folder.
For example, add the following line into the HOSTS file, and change the TCP OPEN statement to use the (dummy) domain name instead of the dotted IP address:
202.123.456.1 dummyname.com
yep that was the first place i looked.
57 under 98 (its not 98 its xp) and other code has worked in the past (when obtaining the ip from the registry)
any more ideas?
Ok,
Not a 100% sure this is it.
but i think its due to the pc picking up its ip via dhcp.
I usea fixed ip, of 192.168.0.233 and all is well.
have no idea why . but this suits me for now. until I release the code.
One time i keept getting this but it was because the ip address contained a CHR$(0) in the end.
This problem is not probable here because its a fixed string, and i dont see any wrong characters.
Try this:
ERRCLEAR
Host Addr "192.168.0.233" To ipAddress&
MSGBOX FORMAT$(ERR)
Tcp Open Server Addr ipAddress& Port %DEFAULT_PORT As gSock
And see what it throws...
Quote from: Elias Montoya on December 11, 2007, 07:33:28 PM
One time i keept getting this but it was because the ip address contained a CHR$(0) in the end.
This problem is not probable here because its a fixed string, and i dont see any wrong characters.
Try this:
ERRCLEAR
Host Addr "192.168.0.233" To ipAddress&
MSGBOX FORMAT$(ERR)
Tcp Open Server Addr ipAddress& Port %DEFAULT_PORT As gSock
And see what it throws...
I tried this. msgbox throws up 0
but still using a fixed Ip works fine....
HS_SetStatusText ("Listening...")
Host Addr "192.168.0.41" To ipAddress&
gConnectingSock = FreeFile
Tcp Open Server Addr ipAddress& Port %DEFAULT_PORT As gConnectingSock
Tcp Notify gConnectingSock, Accept To hwnd_hs As %tcp_connect
If Err Then MsgBox "problem"(different IP because our IT Guys give us a certain range for our fixed IP's