netty_kqueue_bsdsocket.c — netty Source File
Architecture documentation for netty_kqueue_bsdsocket.c, a c file in the netty codebase. 18 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 44b250b5_27aa_4ada_979e_5e4471ea0edc["netty_kqueue_bsdsocket.c"] 8b805ca0_c81c_78ce_2ee8_b68608e7aaa2["netty_kqueue_bsdsocket.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 8b805ca0_c81c_78ce_2ee8_b68608e7aaa2 fe15cf64_2755_0bab_e1c6_27f1c00974e3["netty_unix_errors.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> fe15cf64_2755_0bab_e1c6_27f1c00974e3 5f09cd7f_2abc_453b_acc1_525ddc146a64["netty_unix_filedescriptor.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 5f09cd7f_2abc_453b_acc1_525ddc146a64 6856ca94_355a_7202_2c29_bef2cb72a53b["netty_unix_jni.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 6856ca94_355a_7202_2c29_bef2cb72a53b 8ec31550_62d3_11e4_5541_6d5381c8f160["netty_unix_socket.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 8ec31550_62d3_11e4_5541_6d5381c8f160 9cdab914_3acb_8e23_55b9_b6b0ac295acc["netty_unix_util.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 9cdab914_3acb_8e23_55b9_b6b0ac295acc 6d17d662_a946_868e_4efb_aa2f93ce9359["assert.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 6d17d662_a946_868e_4efb_aa2f93ce9359 d822c438_bcda_8ebc_05f9_1007c55018be["stdlib.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> d822c438_bcda_8ebc_05f9_1007c55018be 71c52c20_b4aa_1551_58db_42e42fa27aa6["errno.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 71c52c20_b4aa_1551_58db_42e42fa27aa6 5cbcd069_b25c_7379_e9c5_47a7dd85985a["string.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 5cbcd069_b25c_7379_e9c5_47a7dd85985a 1cd991d2_f70c_b50c_8f2d_ba89cd654ec5["types.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 1cd991d2_f70c_b50c_8f2d_ba89cd654ec5 8a717ea6_90eb_81a5_9899_bbc73c2bf235["malloc.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 8a717ea6_90eb_81a5_9899_bbc73c2bf235 505c78e3_5429_a273_f5c4_148e73de1d1f["socket.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 505c78e3_5429_a273_f5c4_148e73de1d1f 4094ef75_9fba_3a58_2273_1277324b0041["uio.h"] 44b250b5_27aa_4ada_979e_5e4471ea0edc --> 4094ef75_9fba_3a58_2273_1277324b0041 style 44b250b5_27aa_4ada_979e_5e4471ea0edc fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/*
* Copyright 2016 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/malloc.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <sys/ucred.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include "netty_kqueue_bsdsocket.h"
#include "netty_unix_errors.h"
#include "netty_unix_filedescriptor.h"
#include "netty_unix_jni.h"
#include "netty_unix_socket.h"
#include "netty_unix_util.h"
#define BSDSOCKET_CLASSNAME "io/netty/channel/kqueue/BsdSocket"
// Those are initialized in the init(...) method and cached for performance reasons
static jclass stringClass = NULL;
static jweak peerCredentialsClassWeak = NULL;
static jfieldID fileChannelFieldId = NULL;
static jfieldID transferredFieldId = NULL;
static jfieldID fdFieldId = NULL;
static jfieldID fileDescriptorFieldId = NULL;
static jmethodID peerCredentialsMethodId = NULL;
// JNI Registered Methods Begin
static jlong netty_kqueue_bsdsocket_sendFile(JNIEnv* env, jclass clazz, jint socketFd, jobject fileRegion, jlong base_off, jlong off, jlong len) {
jobject fileChannel = (*env)->GetObjectField(env, fileRegion, fileChannelFieldId);
if (fileChannel == NULL) {
netty_unix_errors_throwRuntimeException(env, "failed to get DefaultFileRegion.file");
return -1;
}
jobject fileDescriptor = (*env)->GetObjectField(env, fileChannel, fileDescriptorFieldId);
if (fileDescriptor == NULL) {
netty_unix_errors_throwRuntimeException(env, "failed to get FileChannelImpl.fd");
return -1;
}
jint srcFd = (*env)->GetIntField(env, fileDescriptor, fdFieldId);
if (srcFd == -1) {
// ... (321 more lines)
Domain
Dependencies
- assert.h
- errno.h
- in.h
- malloc.h
- netty_kqueue_bsdsocket.h
- netty_unix_errors.h
- netty_unix_filedescriptor.h
- netty_unix_jni.h
- netty_unix_socket.h
- netty_unix_util.h
- socket.h
- stdlib.h
- string.h
- tcp.h
- types.h
- ucred.h
- uio.h
- un.h
Source
Frequently Asked Questions
What does netty_kqueue_bsdsocket.c do?
netty_kqueue_bsdsocket.c is a source file in the netty codebase, written in c. It belongs to the Buffer domain.
What does netty_kqueue_bsdsocket.c depend on?
netty_kqueue_bsdsocket.c imports 18 module(s): assert.h, errno.h, in.h, malloc.h, netty_kqueue_bsdsocket.h, netty_unix_errors.h, netty_unix_filedescriptor.h, netty_unix_jni.h, and 10 more.
Where is netty_kqueue_bsdsocket.c in the architecture?
netty_kqueue_bsdsocket.c is located at transport-native-kqueue/src/main/c/netty_kqueue_bsdsocket.c (domain: Buffer, directory: transport-native-kqueue/src/main/c).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free