Skip to content

Commit 0480a02

Browse files
author
Hasnain Virk
authored
Merge pull request #49 from ARMmbed/socket_mesh_patch2
Using socket_close() instead of socket_free()
2 parents 7f5370e + ff5bc03 commit 0480a02

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

source/coap_connection_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static void int_socket_delete(internal_socket_t *this)
259259
this->usage_counter--;
260260
if(this->usage_counter == 0){
261261
clear_secure_sessions(this);
262-
socket_free(this->socket);
262+
socket_close(this->socket);
263263
ns_list_remove(&socket_list, this);
264264
if( this->data ){
265265
ns_dyn_mem_free(this->data);

test/coap-service/unittest/stub/socket_api_stub.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ int8_t socket_open(uint8_t protocol, uint16_t identifier, void (*passed_fptr)(vo
2525
return socket_api_stub.int8_value;
2626
}
2727

28-
int8_t socket_free(int8_t socket)
28+
int8_t socket_close(int8_t socket)
2929
{
3030
if( socket_api_stub.counter >= 0){
3131
return socket_api_stub.values[socket_api_stub.counter--];
3232
}
3333

3434
return socket_api_stub.int8_value;
3535
}
36-
int8_t socket_listen(int8_t socket, ...)
36+
int8_t socket_listen(int8_t socket, uint8_t backlog)
3737
{
3838
if( socket_api_stub.counter >= 0){
3939
return socket_api_stub.values[socket_api_stub.counter--];
@@ -57,14 +57,7 @@ int8_t socket_bind(int8_t socket, const ns_address_t *address)
5757

5858
return socket_api_stub.int8_value;
5959
}
60-
int8_t socket_close(int8_t socket, ns_address_t *address)
61-
{
62-
if( socket_api_stub.counter >= 0){
63-
return socket_api_stub.values[socket_api_stub.counter--];
64-
}
6560

66-
return socket_api_stub.int8_value;
67-
}
6861
int8_t socket_send(int8_t socket, uint8_t *buffer, uint16_t length)
6962
{
7063
if( socket_api_stub.counter >= 0){

0 commit comments

Comments
 (0)