Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Non-blocking ServerSocket code in Matlab

Asked by Willy

Willy (view profile)

on 18 Jun 2013

I am creating multiple ServerSockets ( in Matlab. These servers are waiting for a external client to communicate (one client per server). I am currently running multiple ServerSockets and communicating successfully with their external clients. However, the code pauses until each server accepts its corresponding client.

    socket1 = ServerSocket1.accept;
    % Code Waits until connection 
    socket2 = ServerSocket2.accept;
    % Code Waits until connection
    socket3 = ServerSocket3.accept;
    % Code Waits until connection

I was wondering if I can open a thread/worker/etc to have all the ServerSockets waiting for their respective client.

So far I tried batch without luck.



Willy (view profile)

0 Answers

Contact us