mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-31 03:00:05 +00:00
Changes for VC6 compatibility; added a couple of trimming methods to String; added a parameter to Socket::createConnection
This commit is contained in:
parent
d3ff5d9c4b
commit
93e4236b57
13 changed files with 142 additions and 29 deletions
|
|
@ -429,7 +429,7 @@ void StreamingSocket::close()
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
bool StreamingSocket::createListener (const int newPortNumber)
|
||||
bool StreamingSocket::createListener (const int newPortNumber, const String& localHostName)
|
||||
{
|
||||
if (connected)
|
||||
close();
|
||||
|
|
@ -442,6 +442,10 @@ bool StreamingSocket::createListener (const int newPortNumber)
|
|||
zerostruct (servTmpAddr);
|
||||
servTmpAddr.sin_family = PF_INET;
|
||||
servTmpAddr.sin_addr.s_addr = htonl (INADDR_ANY);
|
||||
|
||||
if (localHostName.isNotEmpty())
|
||||
servTmpAddr.sin_addr.s_addr = ::inet_addr (localHostName.toUTF8());
|
||||
|
||||
servTmpAddr.sin_port = htons ((uint16) portNumber);
|
||||
|
||||
handle = (int) socket (AF_INET, SOCK_STREAM, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue