Harry,
Send an simple ICMP request to find out the printer is available for
communication.
You can use IcmpSendEcho
http://msdn2.microsoft.com/en-us/library/ms927415.aspx
I think OpenNetCF also does the same.
Refer here too
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframewor
k/browse_thread/thread/273197f519fafb47/dc3234d9d6774388?lnk=gst&q=IcmpSendEcho#
dc3234d9d6774388
ICMP will not work with ActiveSync, and if you want to validate with
IPAddress and a port number, try with this code
public static bool IsConnectionEstablished(IPAddress ipAddress, int
port)
{
bool connectStatus = false;
Socket m_ClientSocket = null;
try
{
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress,
port);
m_ClientSocket = new
Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
m_ClientSocket.Connect(ipEndPoint);
connectStatus = m_ClientSocket.Connected;
}
return connectStatus;
}
Hope this helps,
Cheers,
Arun.
> I need to try to ping a QL220 Plus Zebra printer set up as a wireless
> network printer before I try to print to it. I want a quick way to figure
[quoted text clipped - 7 lines]
> TIA
> Harry
news.microsoft.com - 19 Feb 2008 14:08 GMT
Arun,
Thanks for the links....is there anything in CF to do this? These look like
CE functions - any managed code for this or wrapped code?
Guess I really just need to see if the printer is available - it'd look like
a network printer weith IP.
thanks
Harry
Harry,
Send an simple ICMP request to find out the printer is available for
communication.
You can use IcmpSendEcho
http://msdn2.microsoft.com/en-us/library/ms927415.aspx
I think OpenNetCF also does the same.
Refer here too
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframewor
k/browse_thread/thread/273197f519fafb47/dc3234d9d6774388?lnk=gst&q=IcmpSendEcho#
dc3234d9d6774388
ICMP will not work with ActiveSync, and if you want to validate with
IPAddress and a port number, try with this code
public static bool IsConnectionEstablished(IPAddress ipAddress, int
port)
{
bool connectStatus = false;
Socket m_ClientSocket = null;
try
{
IPEndPoint ipEndPoint = new IPEndPoint(ipAddress,
port);
m_ClientSocket = new
Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);
m_ClientSocket.Connect(ipEndPoint);
connectStatus = m_ClientSocket.Connected;
}
return connectStatus;
}
Hope this helps,
Cheers,
Arun.
On Feb 18, 12:05 pm, "news.microsoft.com" <hssimp...@phgt.net> wrote:
> I need to try to ping a QL220 Plus Zebra printer set up as a wireless
> network printer before I try to print to it. I want a quick way to figure
[quoted text clipped - 9 lines]
> TIA
> Harry
<ctacke/> - 19 Feb 2008 14:26 GMT
The OpenNETCF SDF [1] does have Ping capabilities in the NetworkInformation
namespace. It would work identically to the sample on MSDN that Arun pointed
to.

Signature
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
[1] www.opennetcf.com/sdf
> Arun,
>
[quoted text clipped - 56 lines]
>> TIA
>> Harry
news.microsoft.com - 19 Feb 2008 19:30 GMT
That's what I've used with some success:
Private Function CheckConnection() As
OpenNETCF.Net.NetworkInformation.PingReplyDim conn As New
OpenNETCF.Net.NetworkInformation.Ping
Try
Return conn.Send("192.168.0.100", 10)
Catch ex As Exception
End Try
End Function
Thing is when I execute the call and the printer is turned off, the app just
hangs.....figured the timeout was in milliseconds first yet the param is an
integer.
I want it to quickly check - like a quick ping and then if failed drop and
teturn false quickly - but it just kinda hangs up the first ping if false
and subsequent hits are fast.
that second param, does it control how quickly the PingReply is returned?
Harry
> The OpenNETCF SDF [1] does have Ping capabilities in the
> NetworkInformation namespace. It would work identically to the sample on
[quoted text clipped - 61 lines]
>>> TIA
>>> Harry
Mortimer - 27 Mar 2008 14:50 GMT
> That's what I've used with some success:
> Private Function CheckConnection() As
[quoted text clipped - 88 lines]
> >>> TIA
> >>> Harry
Mortimer - 27 Mar 2008 14:53 GMT
Did you find a solution to this?
I'm trying something similar using an IP camera, and need to ping it to
check if its powered on or off using CF