You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
private ManualResetEvent startEvent = new ManualResetEvent(false);
public Client(String address, int port)
{
super(null); //We initialize the socket to null as we will be creating it in the thread. While this isn't great practice, we are fortunate enough that the virtual methods have no critical uses for this variable being initialized (that is before we start the thread method which we will override).
this.address = address;
this.port = port;
}
public Boolean Start()
{
super.start();
startEvent.WaitOne();
return socket != null;
}
@Override
public void run()
{
//Try to set the thread name to the class name, not required but useful for debugging.