Now close method of socket throws IOException.