tcpclient

JAVA sockets - execute PJL command

In Java, I am trying to connect to a printer(Canon iR5050 PCL6) using Sockets, using the host IP with port as 9010. I want to get the status of the printer using PJL command. I write the PJL command (\x1B%-12345X@PJL INFO USTATUS \r\n\x1B%-12345X\r\n) to the socket output stream and try to read the status of the printer from the input st...

TcpClient sometimes needs to wait a few hundred milliseconds to be able to send

Hello everybody. I've got quite a weird problem. I'm writing a wrapper for TcpClient to send and receive HTTP requests. The main reason I don't use the built-in WebRequest is because I need a support for SOCKS proxies, and WebRequest does not support it. Anyway, in one of my tests(That use no proxy, just ordinary TcpClient), I've got a...

In .NET how to detect if the TCP port on the server is opened and/or active?

I need to establish a TCP connection with a remote machine, but before I do that, I need to detect, if the port is in use by another application (if there is already one connection on this port). In other words I want to ensure that only one application is using the same port a time. What is the way to do it in .NET? ...

sending/receiving objects through tcpclient

Hello! i have to send/recieve objects(of a custom class made by me) in my c# .net 4.0 app and i would like a good tutorial to get me started because i've searched on google and there seem to be a lot of problems with serialization/ deserialization and although the problems we're solved, there are a lot of ugly hacks . Regards, Alexa...