hedgewars/uIO.pas
branchexperimental3D
changeset 4844 20b81fafd236
parent 4814 e19791f08443
parent 4825 e8539e429ae3
child 4900 8ad0e23e6d63
equal deleted inserted replaced
4818:202eef454354 4844:20b81fafd236
    94 end;
    94 end;
    95 
    95 
    96 procedure InitIPC;
    96 procedure InitIPC;
    97 var ipaddr: TIPAddress;
    97 var ipaddr: TIPAddress;
    98 begin
    98 begin
    99 WriteToConsole('Init SDL_Net... ');
    99     WriteToConsole('Init SDL_Net... ');
   100 SDLTry(SDLNet_Init = 0, true);
   100     SDLTry(SDLNet_Init = 0, true);
   101 fds:= SDLNet_AllocSocketSet(1);
   101     fds:= SDLNet_AllocSocketSet(1);
   102 SDLTry(fds <> nil, true);
   102     SDLTry(fds <> nil, true);
   103 WriteLnToConsole(msgOK);
   103     WriteLnToConsole(msgOK);
   104 WriteToConsole('Establishing IPC connection... ');
   104     WriteToConsole('Establishing IPC connection to tcp 127.0.0.1:' + IntToStr(ipcPort) + ' ');
   105 {$HINTS OFF}
   105     {$HINTS OFF}
   106 SDLTry(SDLNet_ResolveHost(ipaddr, '127.0.0.1', ipcPort) = 0, true);
   106     SDLTry(SDLNet_ResolveHost(ipaddr, '127.0.0.1', ipcPort) = 0, true);
   107 {$HINTS ON}
   107     {$HINTS ON}
   108 IPCSock:= SDLNet_TCP_Open(ipaddr);
   108     IPCSock:= SDLNet_TCP_Open(ipaddr);
   109 SDLTry(IPCSock <> nil, true);
   109     SDLTry(IPCSock <> nil, true);
   110 WriteLnToConsole(msgOK)
   110     WriteLnToConsole(msgOK)
   111 end;
   111 end;
   112 
   112 
   113 procedure CloseIPC;
   113 procedure CloseIPC;
   114 begin
   114 begin
   115     SDLNet_FreeSocketSet(fds);
   115     SDLNet_FreeSocketSet(fds);