fixes to experimental NormSocket API
parent
9c367b50bc
commit
b66598c119
|
|
@ -1180,6 +1180,7 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
|||
socketEvent.type = NORM_SOCKET_CONNECT;
|
||||
NormSetSynStatus(norm_session, false);
|
||||
socket_state = CONNECTED;
|
||||
|
||||
// Since UDP connect/bind doesn't really work properly on
|
||||
// Windows, the Windows NormSocket server farms out client connections
|
||||
// to new ephemeral port numbers, so we need to update
|
||||
|
|
@ -1187,12 +1188,11 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
|||
remote_node = event.sender;
|
||||
UpdateRemoteAddress();
|
||||
NormChangeDestination(norm_session, NULL, remote_port);
|
||||
if (NORM_OBJECT_INVALID == tx_stream)
|
||||
if ((NORM_OBJECT_INVALID == tx_stream) && !(IsMulticastClient() && IsServerSide()))
|
||||
{
|
||||
tx_stream = NormStreamOpen(norm_session, socket_option.buffer_size);
|
||||
InitTxStream(tx_stream, socket_option.buffer_size, socket_option.segment_size, socket_option.num_data);
|
||||
}
|
||||
|
||||
break;
|
||||
case CONNECTED:
|
||||
if (IsMulticastSocket())
|
||||
|
|
@ -1200,9 +1200,33 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
|||
if (IsServerSocket())
|
||||
{
|
||||
// New client showing up at our multicast party
|
||||
NormSocketInfo* socketInfo = client_table.FindSocketInfo(event.sender);
|
||||
if (NULL == socketInfo)
|
||||
{
|
||||
// Add info for client socket pending acceptance
|
||||
socketInfo = new NormSocketInfo(NormGetSocketInfo(event.sender));
|
||||
if (NULL != socketInfo)
|
||||
{
|
||||
client_table.Insert(*socketInfo);
|
||||
socketEvent.type = NORM_SOCKET_ACCEPT;
|
||||
}
|
||||
else
|
||||
{
|
||||
perror("NormSocket::GetSocketEvent() error: unable to add pending client info to server socket:\n");
|
||||
}
|
||||
}
|
||||
else // duplicative accept event for existing socket, so ignore
|
||||
{
|
||||
ProtoAddress remoteAddr;
|
||||
socketInfo->GetRemoteAddress(remoteAddr);
|
||||
fprintf(stderr, "NormSocket::GetSocketEvent() warning: duplicative %s from client %s/%hu...\n",
|
||||
(NORM_REMOTE_SENDER_NEW == event.type) ? "new" : "reset",
|
||||
remoteAddr.GetHostString(), remoteAddr.GetPort());
|
||||
// TBD - should we go ahead and delete this event.sender???
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// TBD - validate if this same server or not (e.g. by source addr/port)
|
||||
// Different sender showing up in multicast group!?
|
||||
|
|
@ -1429,7 +1453,6 @@ void NormSocket::GetSocketEvent(const NormEvent& event, NormSocketEvent& socketE
|
|||
else
|
||||
{
|
||||
// This still allows at least a chance of an ACK to be sent upon completion
|
||||
TRACE("NormSetUserTimer(5) session: %p\n", norm_session);
|
||||
NormSetUserTimer(norm_session, 0.0);
|
||||
}
|
||||
socketEvent.type = NORM_SOCKET_CLOSING;
|
||||
|
|
|
|||
|
|
@ -936,10 +936,10 @@ class NormFtiExtension5 : public NormHeaderExtension
|
|||
enum
|
||||
{
|
||||
OBJ_SIZE_MSB_OFFSET = (CONTENT_OFFSET)/2, // UINT16 offset
|
||||
OBJ_SIZE_LSB_OFFSET = ((OBJ_SIZE_MSB_OFFSET*2)+2)/4,
|
||||
SEG_SIZE_OFFSET = ((OBJ_SIZE_LSB_OFFSET*4)+4)/2,
|
||||
FEC_NDATA_OFFSET = ((SEG_SIZE_OFFSET+1)*2),
|
||||
FEC_NPARITY_OFFSET = (FEC_NDATA_OFFSET+1)
|
||||
OBJ_SIZE_LSB_OFFSET = ((OBJ_SIZE_MSB_OFFSET*2)+2)/4,// UINT32 offset
|
||||
SEG_SIZE_OFFSET = ((OBJ_SIZE_LSB_OFFSET*4)+4)/2, // UINT16 offset
|
||||
FEC_NDATA_OFFSET = ((SEG_SIZE_OFFSET+1)*2), // UINT8 offset
|
||||
FEC_NPARITY_OFFSET = (FEC_NDATA_OFFSET+1) // UINT8 offset
|
||||
};
|
||||
}; // end class NormFtiExtension5
|
||||
|
||||
|
|
|
|||
2
protolib
2
protolib
|
|
@ -1 +1 @@
|
|||
Subproject commit 66092403ffeda703ad5e563be068db345f111a3c
|
||||
Subproject commit 702e909945446275f0313846e988612883fca94a
|
||||
Loading…
Reference in New Issue