Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with sockets

Status
Not open for further replies.

dogo1984

Programmer
Sep 1, 2002
24
DE
Hi i have got a problemm with sockets i have a code and if i compile it and want to start there is a socket error.

My error is: java.net.SocketException: Unrecongnized Windows Sockets error: 10106: create

My source code:

import java.util.*;
import java.io.*;
import java.net.*;

public class Server
{
private static final int PORT = 1306;

public Server(){}

public static final void main(String[] arguments)
{
try
{
ServerSocket server_socket = new ServerSocket(PORT);

System.out.println("Server : wait ... ");
Socket sogget = server_socket.accept();
System.out.println("Server : connection ok!");

BufferedReader input = new BufferedReader( new InputStreamReader(sogget.getInputStream()));

System.out.println(" Server : recieved \"" + input.readLine() + "\"");

OutputStreamWriter out_put = new OutputStreamWriter(sogget.getOutputStream());

output.write("OK.");
output.flash();

System.out.println("Server : reply \"ok.\"");
}
catch(IOException ioe)
{
ioe.printStackTrace();
}
}
}


thx for help



Developer System:

Win 2k Professional with Service Pack 3
1800+ Athlon XP
1 Networkcard
No Firewall or something else
No Anti-Virus-Programm
 
Hi,
did you tried to change the port number to something like 55555 or 12345 ?
Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top