2012-10-04 47 views
1

我是新來的Matlab環境下Matlab的服務器程序錯誤

我嘗試使用現有的Java服務器套接字代碼 這裏implenment Matlab的套接字服務器是Matlab的服務器的代碼

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

    try 
     providerSocket = ServerSocket(4443, 10); 

     System.out.println('Waiting for connection'); 
     connection = providerSocket.accept(); 
     System.out.println('Connection received from '); 

     out = ObjectOutputStream(connection.getOutputStream()); 
     out.flush(); 
     in = ObjectInputStream(connection.getInputStream()); 
     sendMessage('Connection successful'); 

    catch ME 

這裏是錯誤當MATLAB執行我有...

error(ME.identifier, 'Connection Error: %s', ME.message) 
    end 


Connection Error: Java exception occurred: 
java.net.SocketException: Unrecognized Windows Sockets 
error: 0: JVM_Bind 

at java.net.PlainSocketImpl.socketBind(Native Method) 

at java.net.PlainSocketImpl.bind(Unknown Source) 

at java.net.ServerSocket.bind(Unknown Source) 

at java.net.ServerSocket.<init>(Unknown Source) 

at java.net.ServerSocket.<init>(Unknown Source) 

謝謝 請幫我傢伙

回答

0

這很可能是一些其他的插座阻止端口4443如果使用不同的端口工作正常,那麼這就是問題所在。獲取sysinternals工具以查看哪些端口已打開 - 特別是TCPView

相關問題